目录
环境:
系统:CentOS7.9
| IP | 数据盘 | 分区形式 | mongos | config server | shard1 | shard2 | shard3 |
|---|---|---|---|---|---|---|---|
| 192.168.100.21 | vdb | lvm | 27017 | 27018 | 27001 | 27002 | 27003 |
| 192.168.100.22 | vdb | lvm | 27017 | 27018 | 27001 | 27002 | 27003 |
| 192.168.100.23 | vdb | lvm | 27017 | 27018 | 27001 | 27002 | 27003 |
# 1. 关闭selinux、firewall
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
setenforce 0
systemctl disable firewalld.service
systemctl stop firewalld.service
systemctl status firewalld.service
# 2. 系统打开文件数
#系统打开文件数【单独下边两步需要重启才生效】
grep -w "^* soft nofile.*" /etc/security/limits.conf || echo "* soft nofile 61440" >> /etc/security/limits.conf
grep -w "^* hard nofile.*" /etc/security/limits.conf || echo "* hard nofile 61440" >> /etc/security/limits.conf
grep -w "^DefaultLimitNOFILE.*" /etc/sys

本文详细介绍在CentOS 7.9环境下部署MongoDB集群的过程,包括环境准备、系统配置、服务安装与启动、集群配置等关键步骤,并实现了数据分片及密码认证功能。
最低0.47元/天 解锁文章
429

被折叠的 条评论
为什么被折叠?



