
Preliminary research on MongoDB database cluster
1. Testing principle —————————————————————————————————— 1. Introduction to Sharding cluster This is a horizontally scalable model with excellent performance when the amount of data is large. Actual large-scale applications generally use this architecture to build mongodb systems. To build a MongoDB Sharding Cluster, three roles are required: Shard Server: mongod instance, used to store actual data blocks, a shard in the actual production environment The server role can be assumed by several machines forming a replica set to prevent a single point of host failure. Config Server: mongod instance, which stores the entire Cluster Metadata, including chunk information. Route Server: mongos Instances, front-end routing, clients access from this, and make the entire cluster look like a single database, so that front-end applications can be used transparently. Sharding architecture diagram: 2. Description of this test environment Install centos5.6+MongoDB1.9.1 on 4 machines The IP addresses are: 192.168.3.4, 192.168.3.21, 192.168.3.29, 192.168.3.79 The replica set1 port is 3500 Replica set2 port is 3600 The config server port is 5000 The mongos port is 5500 1. Run a mongod instance on two machines respectively, organized as replica set1, as node1 of the cluster. 2. Then run a mongod instance on two machines respectively, organized as replica…

Preliminary Research on MongoDB Database Cluster
One, test principle ————————————————————————————————————— 1. Introduction to Sharding cluster This is a mode that can be expanded horizontally and has excellent performance when the amount of data is large. In actual large-scale applications, this architecture is generally used to build mongodb systems. To build a MongoDB Sharding Cluster, three roles are required: Shard Server: mongod instance, used to store actual data blocks, a shard in the actual production environment The server role can be assumed by several machines forming a replica set to prevent single point failure of the host. Config Server: mongod instance, which stores the entire Cluster Metadata, including chunks information. Route Server: mongos Instances, front-end routing, and client access, and make the entire cluster look like a single database, so that front-end applications can be used transparently. Sharding structure diagram: 2, Description of the test environment Install centos5.6+MongoDB1.9.1 on 4 machines Ip addresses are: 192.168.3.4, 192.168.3.21, 192.168.3.29, 192.168.3.79 The replica set1 port is 3500 The replica set2 port is 3600 config server port is 5000 mongos port is 5500 1. Run a mongod instance on two machines respectively and organize it as replica set1 as node1 of the cluster. 2. Then run a mongod instance on the…