MongoDB knowledge point notes

Source: Internet
Author: User
Tags install mongodb

MongoDB knowledge point notes

MongoDB knowledge point notes

1. How to read data from the backup Node

The default value is not allowed. The following error is reported:

testReplSet:SECONDARY> show dbs2016-07-19T10:25:03.196+0800 E QUERY    [thread1] Error: listDatabases failed:{ "ok" : 0, "errmsg" : "not master and slaveOk=false", "code" : 13435 } 

To allow the backup node to read data, run the following command:

db.getMongo().setSlaveOk()

2. About backup Sets

1> all operations performed by the client on a single server can be sent to the master node for execution (read, write, Execute Command, create index, etc)

2> the client cannot perform write operations on the backup node.

3> by default, the client cannot read data from the backup node unless the setSlaveOk operation is performed explicitly.

4> a single server cannot be converted to a replica set. Unless the off service is reinitialized, we recommend that you configure the replica set even if there is only one server, in this way, you do not need to stop the service after adding nodes.

5> a very important concept of replica set is "majority": it is up to the majority to select the master node. The master node can continue to serve as the master node only when the majority of support is obtained, this write operation is performed when the write operation is copied to most members.

It is safe.

3. How to view the command line parameters of the server

Db. server‑lineopts ()

4. too logs chunks to print, use verbose if you want to force print

You can run the following command to view

PrintShardingStatus (db. getSisterDB ("config"), 1 );

For more MongoDB tutorials, see the following:

CentOS compilation and installation of php extensions for MongoDB and mongoDB

CentOS 6 install MongoDB and server configuration using yum

Install MongoDB2.4.3 in Ubuntu 13.04

MongoDB beginners must read (both concepts and practices)

MongoDB Installation Guide for Ubunu 14.04

MongoDB authoritative Guide (The Definitive Guide) in English [PDF]

Nagios monitoring MongoDB sharded cluster service practice

Build MongoDB Service Based on CentOS 6.5 Operating System

MongoDB details: click here
MongoDB: click here

This article permanently updates the link address:

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.