Mongodb复制集搭建
以3个节点为例子
1. 分别配置三个配置文件,文件目录,日志目录
systemLog:
verbosity: 1
destination: file
path: "/root/software/mongod_replication/replication2/logs/mongod.log"
logAppend: true
storage:
dbPath: "/root/software/mongod_replication/replication2/db"
journal:
enabled: true
processManagement:
fork: true
net:
bindIp: 0.0.0.0
port: 29017
replication:
replSetName: rs0
#setParameter:
# enableLocalhostAuthBypass: false
分别启动三个mongod进程
mongod -f mongod.conf
2. 配置复制级
mongo 192.168.6.180:27017 // 链接到其中一个复制集中
rs.initiate()
rs.add("192.168.6.180:29017") // 分别将另外两个节点加入到复制集中
rs.add("192.168.6.180:28017")
相关推荐
lbyd0 2020-11-17
BigYellow 2020-11-16
sushuanglei 2020-11-12
我心似明月 2020-11-09
zhushenghan 2020-11-09
sunnnyduan 2020-10-16
不要皱眉 2020-10-14
xiaohai 2020-09-29
songxiugongwang 2020-09-22
萌亖 2020-09-17
LuckyLXG 2020-09-08
sdmzhu 2020-09-01
mkhhxxttxs 2020-09-16
xiaohai 2020-09-16
newcome 2020-09-09
jaylong 2020-08-19
大秦铁骑 2020-08-19
thatway 2020-08-19