时间:2021-07-01 10:21:17 帮助过:46人阅读
主机192.168.99.80
[root@master ~]# grep -v "^#" /etc/mongod.conf | grep -v "^$" bind_ip = 192.168.99.80 fork = true pidfilepath = /var/run/mongodb/mongod.pid logpath = /var/log/mongodb/mongod.log unixSocketPrefix = /var/run/mongodb dbpath = /mongodb/data httpinterface = true rest = true replSet = testSet replIndexPrefetch = _id_only
主机192.168.99.81
[root@master ~]# grep -v "^#" /etc/mongod.conf | grep -v "^$" bind_ip = 192.168.99.81 fork = true pidfilepath = /var/run/mongodb/mongod.pid logpath = /var/log/mongodb/mongod.log unixSocketPrefix = /var/run/mongodb dbpath = /mongodb/data httpinterface = true rest = true replSet = testSet replIndexPrefetch = _id_only
主机192.168.99.70
[root@master ~]# grep -v "^#" /etc/mongod.conf | grep -v "^$" bind_ip = 192.168.99.70 fork = true pidfilepath = /var/run/mongodb/mongod.pid logpath = /var/log/mongodb/mongod.log unixSocketPrefix = /var/run/mongodb dbpath = /mongodb/data httpinterface = true rest = true replSet = testSet replIndexPrefetch = _id_only
启动三台主机
mongo --host 192.168.99.81
在192.168.99.80添加
本文出自 “迷荼” 博客,谢绝转载!
mongoDB的副本机制
标签:mongodb 副本 机制