Host 192.168.99.80
[Email protected] ~]# grep-v "^#"/etc/mongod.conf | Grep-v "^$" bind_ip = 192.168.99.80fork = Truepidfilepath =/var/run/mongodb/mongod.pidlogpath =/var/log/mongodb/mongod . Logunixsocketprefix =/var/run/mongodbdbpath =/mongodb/datahttpinterface = Truerest = TruereplSet = Testsetreplindexprefetch = _id_only
Host 192.168.99.81
[Email protected] ~]# grep-v "^#"/etc/mongod.conf | Grep-v "^$" bind_ip = 192.168.99.81fork = Truepidfilepath =/var/run/mongodb/mongod.pidlogpath =/var/log/mongodb/mongod . Logunixsocketprefix =/var/run/mongodbdbpath =/mongodb/datahttpinterface = Truerest = TruereplSet = Testsetreplindexprefetch = _id_only
Host 192.168.99.70
[Email protected] ~]# grep-v "^#"/etc/mongod.conf | Grep-v "^$" bind_ip = 192.168.99.70fork = Truepidfilepath =/var/run/mongodb/mongod.pidlogpath =/var/log/mongodb/mongod . Logunixsocketprefix =/var/run/mongodbdbpath =/mongodb/datahttpinterface = Truerest = TruereplSet = Testsetreplindexprefetch = _id_only
Start three hosts
MONGO--host 192.168.99.81
Add in 192.168.99.80
This article from "Fan tea" blog, declined reprint!
The copy mechanism of MongoDB