標籤:mongodb 副本 機制
主機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
主機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
主機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
啟動三台主機
mongo --host 192.168.99.81
在192.168.99.80添加
本文出自 “迷荼” 部落格,謝絕轉載!
mongoDB的副本機制