MongoDB Tenth article ~ Exploring the cluster of MongoDB

Source: Internet
Author: User
Tags mongodb database sharding

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.