MongoDB replica set expands to Machine shard
Shard Cluster Composition Description
1 replset (replica set, number of data storing shards)
2 mongo_config (cluster configuration center, storage metadata you can understand the mycat with various configurations)
3 MONGOs (API provider, Route does not store data)
Start each service
0 initiating replicas and services
/data/mongo/mongodb/bin/mongod--config/etc/mongodb_sh.conf
1 starting three Configuration center services
/data/mongo/mongodb/bin/mongod--config/etc/mongodb_conf.conf
2 starting three MONGOs routing services
/data/mongo/mongodb/bin/mongos--config/etc/mongodb_route.conf
Start shutdown sequence 1 All routing services, 2 all config configuration services->3 all shard nodes (from node-to-master node)
Two test ports
0 Test Replica Set Inbound
MONGO--port=27022
1 Test Configuration Center Entry
MONGO--port=30000
2 Test Routing Inbound
MONGO--port=40000
Three configuration Centers for configuration
1 Entering the routing port
Sh.status () to view
Balancer
Currently Enabled:yes
Currently Running:no
Equalizer View balancer for internal movement of data blocks, self-tuning of the cluster belonging to MongoDB
Databases
"_id": "admin", "partitioned": false, "PRIMARY": "Config"}
Shard
Records the status of the Shard cluster member, because no members have been added here, so it is empty
Database sharding records the database fragmentation of the whole cluster
2 adding shards for a cluster
Just add a member here.
Use admin
Db.runcommand ({addshard: "fuzhiji/:37011,10.:37011,:37011", Name: "Shard1", maxsize:20480})
Sh.status view can be seen
Four Common cluster commands
MongoDB Tenth article ~ Exploring the cluster of MongoDB