Test environment
Four test server 10.151.151.150:27017 (Master node), 10.151.151.151:27017 (from node), 10.151.151.152:27018 (from node), 10.151.151.152:27017 (quorum node), 10.151.15 1.143:30000 (MONGOs), 10.151.151.143:10000 (Configserver)
1. First set up the replica set, based on the node above
Build process (slightly)
2. Second establishment of Configserver
Turn on the MONGOs service on a 143 server
/media/mongo/mongodb/bin/mongod--configsvr--port 10000--dbpath/media/mongo/configdata--fork--logpath/media/ Mongo/configlog/config.log--directoryperdb
3. Establish MONGOs
./mongos--port 30000--configdb 10.151.151.143:10000--fork--logpath/media/mongo/route.log--chunkSize 100
4. Adding a replica set
Enter MONGOs
./mongo 10.151.151.143:30000
Db.runcommand ({addshard: "rep1/ 10.151.151.150:27017,10.151.151.151:27017,10.151.151.152:27017,10.151.151.152:27018 "})
After a successful run, you can test it in Vue
MongoDB Fail-Over