MongoDB (automatic sharding + shard backup) machine failure (simulation using kill-9) Stability Test

Source: Internet
Author: User

First, create a MongoDB design drawing for testing:

The figure is clear. Can take my other notes: http://blog.csdn.net/crazyjixiang/article/category/844957 if not clear please leave a message

Replication set is used to avoid data loss on a single node.

The test results are as follows:

Insert 228 million data records on the server. After the insertion is complete, the 162 server is disconnected and then executed in mongos quickly.

> db.users.count()Fri Jul 29 16:05:11 uncaught exception: count failed: {        "assertion" : "DBClientBase::findOne: transport error: 10.10.21.162:27017 query: { setShardVersion: \"test.users\", configdb: \"10.7.3.228:27019\", version: Timestamp 5000|1, serverID: ObjectId('4e325735277d2098a18b5cca'), shard: \"set162163228\", shardHost: \"set162163228/10.10.21.162:27018,10.10.21.163:27017\" }",        "assertionCode" : 10276,        "errmsg" : "db assertion failure",        "ok" : 0}

If an exception is thrown, run dB. Users. Count ()

> db.users.count()10000000

It is found that it is normal. 163 is changed to primary.

Then, continue to insert 163 million data, and disconnect the server when the insertion process is interrupted.

The insert operation is normal. After the insertion, we compare the data of the following 164 servers + the data on the 162 servers connected is exactly equal to 2000.

After the two servers are connected again, the data keeps changing and load balancing is ongoing.

NOTE: If an instant power failure occurs in the data center, the data may still be faulty, but this probability is very small.

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.