MongoDB Broken Read

Source: Internet
Author: User

1. How to read data from a backup node

Default is not allowed, the following error will be reported:

Testreplset:secondary> Show dbs- -19t10:03.196+0800 E QUERY    "OK"0"errmsg" " Not master and Slaveok=false""code"13435

If you want to allow the backup node to read data, you need to execute the following command

Db.getmongo (). Setslaveok ()

2. About Backup Sets

1> the actions that the client performs on a stand-alone server can be sent to the master node for execution (read, write, execute commands, create indexes, etc.)

2> clients cannot perform write operations on backup nodes

3> By default, clients cannot read data from backup nodes unless the Setslaveok operation is explicitly performed.

4> cannot convert a stand-alone server to a replica set, unless the service is reinitialized, it is recommended that, even if there is only one server, it is configured as a replica set, so that subsequent additions to the node do not require a service outage.

A very important concept in the 5> replica set is "most": Selecting the primary node is the majority decision, and the master node can continue to be the primary node only if most of the support is available, and the write operation is copied to most members

is safe.

3. How to view command line parameters for a server

Db.servercmdlineopts ()

4. Too many chunks to print, use verbose if you want to force print

You can view it by executing the following command

Printshardingstatus (Db.getsisterdb ("config"), 1);

MongoDB Broken Read

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.