当前位置: 首页 > news >正文

上海做网站哪里有广州顶正餐饮培训学校

上海做网站哪里有,广州顶正餐饮培训学校,什么网站做设计可以赚钱吗,查询网网站总结:整理不易,如果对你有帮助,可否点赞关注一下? 更多详细内容请参考:《Linux运维篇:Linux系统运维指南》 一、部署背景 由于业务系统的特殊性,我们需要面向不通的客户安装我们的业务系统&…

总结:整理不易,如果对你有帮助,可否点赞关注一下?

更多详细内容请参考:《Linux运维篇:Linux系统运维指南》


一、部署背景

由于业务系统的特殊性,我们需要面向不通的客户安装我们的业务系统,而作为基础组件中的mongodb针对不同的客户环境需要多次部署集群,作为一个运维工程师,提升工作效率也是工作中的重要一环。所以我觉得有必要针对 X86_64 + ARM64 CPU架构mongodb 7.0.14容器版 分片集群编写自动化部署工具。

CPU架构 docker版本 docker-compose版本
X86_64 26.1.3 v2.29.0
ARM64 26.1.3 v2.29.0

二、工具介绍

一键部署工具实现功能如下:

1、支持ARM64、X86_64架构CPU
2、支持单实例部署
3、支持单机伪分片集群部署(1个config副本集+2个分片副本集+3路由节点)
4、支持多机分布式分片集群部署(1个config副本集+2个分片副本集+3路由节点)
5、支持数据目录、日志目录、端口、账号、密码、副本集合名称、最大并发连接数等灵活配置
6、支持数据文件、日志文件、配置文件持久化
7、支持创建、启动、停止、卸载等操作
8、支持一键连接、一键备份、一键还原等操作

如下图所示:
在这里插入图片描述
在这里插入图片描述

说明:工具使用非常简单,只需要修改变量文件,就可以快速帮你快速部署mongodb 7.0.14分片集群。


三、工具下载

基于X86_64+ARM64架构CPU使用docker-compose一键离线部署mongodb 7.0.14容器版分片集群工具


四、部署步骤

说明:单机伪集群是指在单主机部署mongodb分片集群,分布式集群是指在多个不同主机上部署mongodb分片集群,这里部署的是多机分布式分片集群。


1、查看帮助命令
在这里插入图片描述


2、部署规划

说明:这里由于资源限制,使用4台服务器部署分片集群。如果你的资源充足,建议每个实例使用单独1台服务器部署。

宿主机IP 操作系统 内核版本 节点说明
192.168.1.111 操作系统 5.15.0-113-generic 配置服务副本集(1primary+2secondary,共3个实例)
192.168.1.112 操作系统 5.15.0-113-generic 分片1副本集(1primary+1secondary+1arbiter,共3个实例)
192.168.1.113 操作系统 5.15.0-113-generic 分片2副本集(1primary+1secondary+1arbiter,共3个实例)
192.168.1.114 操作系统 5.15.0-113-generic 路由节点(3个mongos实例)

3、准备一键部署工具包

说明:将一键部署工具包分别上传到mongodb分片集群所有节点上。


4、编辑变量文件

说明:以下操作分别在mongodb分片集群节点的部署工具包中修改cluster.conf文件, 三个节点上cluster.conf文件内容一致

root@localhost:/opt/mongodb-shard-cluster# cp cluster.conf.tpl cluster.conf
root@localhost:/opt/mongodb-shard-cluster# vim cluster.conf
# 部署顺序: 
#   1、配置节点 > 分片节点1 > 分片节点2 > 路由节点
#   2、配置节点顺序为secondary2>secondary1>primary,分片节点顺序为arbiter>secondary>primary,路由节点顺序为route1>route2>route3
# 建议填写为当前磁盘最大存储空间目录,如果系统盘空间最大,建议填写为/data,如果挂在盘空间最大,建议填写为挂载目录
export BASE_DIR="/data"# cpu架构,可选值为<x86_64和aarch64>,根据实际情况修改
export CPU_PLATFROM="x86_64"# mongodb版本,默认不修改
export MONGODB_VERSION="7.0.14"# Mongodb数据存放根目录,默认即可,建议不要修改
export MONGODB_DATA_DIR="${BASE_DIR}/basic-data/mongodb-shard-cluster"
##################################################################################################################
# 注意:容器网络模式为<host主机网络模式>,监听地址填写为宿主机内网地址,<主机名为容器的主机名,非宿主机主机名>
# mongodb<配置服务>副本集信息
export MONGODB_CONFIG_PRIMARY_HOST_IP="192.168.1.111"                     # primary实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_CONFIG_PRIMARY_HOST_NAME="config-primary.mongo.com"        # primary实例主机名,可根据实际情况修改
export MONGODB_CONFIG_PRIMARY_HOST_PORT="17101"                           # primary实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_CONFIG_SECONDARY1_HOST_IP="192.168.1.111"                  # secondary1实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_CONFIG_SECONDARY1_HOST_NAME="config-secondary1.mongo.com"  # secondary1实例主机名,可根据实际情况修改
export MONGODB_CONFIG_SECONDARY1_HOST_PORT="17102"                        # secondary1实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_CONFIG_SECONDARY2_HOST_IP="192.168.1.111"                  # secondary2实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_CONFIG_SECONDARY2_HOST_NAME="config-secondary2.mongo.com"  # secondary2实例主机名,可根据实际情况修改
export MONGODB_CONFIG_SECONDARY2_HOST_PORT="17103"                        # secondary2实例映射宿主机端口,端口不冲突情况下,建议不修改
export MONGODB_CONFIG_REPLICASET_NAME="config-rs"                         # config服务副本集合名称,默认即可,建议不修改# mongodb<分片1>副本集信息
export MONGODB_SHARD1_PRIMARY_HOST_IP="192.168.1.112"                     # primary实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD1_PRIMARY_HOST_NAME="shard1-primary.mongo.com"        # primary实例主机名,可根据实际情况修改
export MONGODB_SHARD1_PRIMARY_HOST_PORT="17201"                           # primary实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_SHARD1_SECONDARY_HOST_IP="192.168.1.112"                   # secondary实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD1_SECONDARY_HOST_NAME="shard1-secondary.mongo.com"    # secondary实例主机名,可根据实际情况修改
export MONGODB_SHARD1_SECONDARY_HOST_PORT="17202"                         # secondary实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_SHARD1_ARBITER_HOST_IP="192.168.1.112"                     # arbiter实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD1_ARBITER_HOST_NAME="shard1-arbiter.mongo.com"        # arbiter实例主机名,可根据实际情况修改
export MONGODB_SHARD1_ARBITER_HOST_PORT="17203"                           # arbiter实例映射宿主机端口,端口不冲突情况下,建议不修改
export MONGODB_SHARD1_REPLICASET_NAME="shard1-rs"                         # 分片1副本集合名称,默认即可,建议不修改# mongodb<分片2>副本集信息
export MONGODB_SHARD2_PRIMARY_HOST_IP="192.168.1.113"                     # primary实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD2_PRIMARY_HOST_NAME="shard2-primary.mongo.com"        # primary实例主机名,可根据实际情况修改
export MONGODB_SHARD2_PRIMARY_HOST_PORT="17301"                           # primary实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_SHARD2_SECONDARY_HOST_IP="192.168.1.113"                   # secondary实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD2_SECONDARY_HOST_NAME="shard2-secondary.mongo.com"    # secondary实例主机名,可根据实际情况修改
export MONGODB_SHARD2_SECONDARY_HOST_PORT="17302"                         # secondary实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGODB_SHARD2_ARBITER_HOST_IP="192.168.1.113"                     # arbiter实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGODB_SHARD2_ARBITER_HOST_NAME="shard2-arbiter.mongo.com"        # arbiter实例主机名,可根据实际情况修改
export MONGODB_SHARD2_ARBITER_HOST_PORT="17303"                           # arbiter实例映射宿主机端口,端口不冲突情况下,建议不修改
export MONGODB_SHARD2_REPLICASET_NAME="shard2-rs"                         # 分片2副本集合名称,默认即可,建议不修改# mongods<路由实例>信息
export MONGOS_ROUTE1_HOST_IP="192.168.1.114"                              # mongos1实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGOS_ROUTE1_HOST_NAME="route1.mongo.com"                         # mongos1实例主机名,可根据实际情况修改
export MONGOS_ROUTE1_HOST_PORT="17401"                                    # mongos1实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGOS_ROUTE2_HOST_IP="192.168.1.114"                              # mongos2实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGOS_ROUTE2_HOST_NAME="route2.mongo.com"                         # mongos2实例主机名,可根据实际情况修改
export MONGOS_ROUTE2_HOST_PORT="17402"                                    # mongos2实例映射宿主机端口,端口不冲突情况下,建议不修改export MONGOS_ROUTE3_HOST_IP="192.168.1.114"                              # mongos3实例监听地址,建议填写<宿主机内网地址>,根据实际情况填写
export MONGOS_ROUTE3_HOST_NAME="route3.mongo.com"                         # mongos3实例主机名,可根据实际情况修改
export MONGOS_ROUTE3_HOST_PORT="17403"                                    # mongos3实例映射宿主机端口,端口不冲突情况下,建议不修改# mongos或mongod接受的最大并行连接数,如果该设置高于操作系统配置<文件描述符,ulimit -n>的最大连接跟踪阈值,则该设置无效 
export MONGODB_MAX_CONNECTIONS="10000"# Mongodb分片集群<admin库+管理账号+密码>,密码要求大小写和数字,且8位以上,根据实际情况填写
# 注意:<分片集群用户admin库管理账号密码>与<本地分片admin库用户管理账号和密码>相同,均使用MONGODB_ADMIN_USER和MONGODB_ADMIN_PASSWORD变量
export MONGODB_ADMIN_USER="admin"          
export MONGODB_ADMIN_PASSWORD="Kzyh9nwyDWuL"# Mongodb分片集群<读写库+用户账号+密码>,密码要求大小写和数字,且8位以上,根据实际情况填写
# 注意:<分片集群读写库用户管理账号密码>与<本地分片读写库用户管理账号和密码>相同,均使用MONGODB_ADMIN_USER和MONGODB_ADMIN_PASSWORD变量
export MONGODB_READWRITE_DATABASE="lolaage"
export MONGODB_READWRITE_USER="lolaage"
export MONGODB_READWRITE_PASSWORD="Kzyh9nwyDWuL"
##################################################################################################################

5、执行部署

说明:部署顺序必须为
1、配置节点 > 分片节点1 > 分片节点2 > 路由节点
2、配置节点顺序为secondary2>secondary1>primary,分片节点顺序为arbiter>secondary>primary,路由节点顺序为route1>route2>route3


a、配置服务副本集部署(192.168.1.111)

root@localhost:/opt/mongodb-shard-cluster# ./op.sh build config-secondary2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build config-secondary1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build config-primary

如下图所示:
在这里插入图片描述


b、分片1副本集部署(192.168.1.112)

root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard1-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard1-primary

如下图所示:
在这里插入图片描述


c、分片2副本集部署(192.168.1.113)

root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard2-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build shard2-primary

如下图所示:
在这里插入图片描述


d、路由节点部署(192.168.1.114)

root@localhost:/opt/mongodb-shard-cluster# ./op.sh build route1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build route2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh build route3

如下图所示:
在这里插入图片描述


6、检查集群状态

root@localhost:/opt/mongodb-shard-cluster# ./op.sh check route3

如下图所示:
在这里插入图片描述


五、其它操作

5.1、启动

说明:分别在对应主机节点上执行。

root@localhost:/opt/mongodb-shard-cluster# ./op.sh start config-secondary2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start config-secondary1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start config-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard1-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard1-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard2-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start shard2-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh start route1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start route2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh start route3

5.2、停止

说明:分别在对应主机节点上执行。

root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop config-secondary2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop config-secondary1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop config-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard1-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard1-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard2-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop shard2-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh stop route1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop route2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh stop route3

5.3、检查

说明:分别在对应主机节点上执行。

root@localhost:/opt/mongodb-shard-cluster# ./op.sh check config-secondary2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check config-secondary1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check config-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard1-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard1-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard2-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check shard2-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh check route1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check route2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh check route3

5.4、卸载

说明:分别在对应主机节点上执行。

root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear config-secondary2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear config-secondary1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear config-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard1-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard1-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard2-secondary
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear shard2-primaryroot@localhost:/opt/mongodb-shard-cluster# ./op.sh clear route1
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear route2
root@localhost:/opt/mongodb-shard-cluster# ./op.sh clear route3

5.5、连接

说明:分别在对应主机节点上执行。

root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect config-secondary2
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect config-secondary1
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect config-primaryroot@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard1-arbiter
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard1-secondary
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard1-primaryroot@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard2-arbiter
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard2-secondary
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect shard2-primaryroot@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect route1
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect route2
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_connect.sh connect route3

5.6、备份(支持单机和分片集群模式)

说明:在route3节点上执行。

root@localhost:/opt/mongodb-shard-cluster# cd tools
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_backup.sh backup route3

注意:如果你想手动备份还原,建议参考《Linux运维总结:使用 MongoDB工具备份和恢复mongodb 7.0.14分片集群(方案一)》。


5.7、还原(仅支持单机模式)

root@localhost:/opt/mongodb-shard-cluster# cd tools
root@localhost:/opt/mongodb-shard-cluster/tools# ./auto_backup.sh backup single

注意:由于分片集群还原操作,比较复杂,建议参考《Linux运维总结:使用 MongoDB工具备份和恢复mongodb 7.0.14分片集群(方案一)》。


总结:整理不易,如果对你有帮助,可否点赞关注一下?

更多详细内容请参考:《Linux运维篇:Linux系统运维指南》

http://www.15wanjia.com/news/13006.html

相关文章:

  • 我们网站百度快照显示违规内容windows 优化大师
  • 万户网络待遇怎么样seo外链优化策略
  • 做网站是不是太麻烦了百度关键词首页排名
  • 长沙网约车驾驶员资格证网上报名西安seo排名公司
  • 网上做兼职正规网站网络精准营销推广
  • 用360打开自己做的网站有广告厦门百度关键词优化
  • 办公邮箱最常用的是什么邮箱搜索引擎优化方法包括
  • 中企动力网站建设公司免费建站工具
  • 中山外贸网站建设公司济南seo小黑seo
  • 洛阳住房和城乡建设部网站优质的seo快速排名优化
  • 手机端移动网站建设连接交换
  • 上海网网站建设惠州seo关键字排名
  • 网站开发开票税率seo外链工具下载
  • 花钱想贷款结果成了做网站如何优化网络
  • 做电影网站程序好用吗谷歌google 官网下载
  • 网页设计图片素材网seo网站优化经理
  • 网站建设开发服务费税率广告销售如何寻找客户
  • 武汉网络推广专员优化大师客服
  • 四川做网站设计公司价格百度上怎么做推广
  • 做胃肠医院网站百度投广告怎么收费
  • 自适应企业网站成都网站设计
  • 动漫制作专业前景seo兼职工资一般多少
  • 惠州网站建设 熊掌号长春seo主管
  • 郴州公司做网站网上商城推广13种方法
  • dedecms网站地图制作seo快排优化
  • 网站开发 价格差异宁德seo推广
  • 怎样做公司网站建设培训学校管理制度大全
  • 私人订制旅游网站建设百度地图导航2021最新版
  • 公司网站开发方案20个排版漂亮的网页设计
  • 珠海品牌设计公司seo的实现方式