Mongodb background running, mongodb background

Source: Internet
Author: User
Tags install mongodb

Mongodb background running, mongodb background

By default, if shell is disabled, mongodb stops running.

To run it in the background, you only need to add the -- fork function at startup.

You can add -- logappend to the Log Path to prevent logs from being deleted.

Bin/mongodb -- fork -- dbpath = // -- logpath = // -- logappend

Run it in the background. If you want to disable it, send shutdownServer () to it ()

1. Common commands: $./mongod> use admin> db. shutdownServer ()
Note that this command is only allowed locally or an authenticated client.
2. If this is a master-slave replication cluster, it will be closed after version 1.9.1 following the steps below
  • Check the data update time from Mongodb
  • If the time difference between all the slave Mongodb and the master database exceeds 10, the mongodb will not be closed at this time (in this case, we can configure timeoutSecs to update the data from the Mongodb)
  • If there is a time difference between Mongodb and the primary service within 10 seconds, the primary server will be shut down and wait until the updates from the primary service are complete and closed.
3. If you do not have up-to-date data from Mongodb and want to force disable the service, you can add force: true. The command is as follows:> db. adminCommand ({shutdown: 1, force: true})> // or> db. shutdownServer ({force: true })
4. Shut down the server at a specified time-out. The command is the same as above, and a timeoutsec is added: parameter> db. adminCommand (shutdown: 1, force: true, timeoutsec: 5)> // or> db. shutdownServer ({force: true, timeoutsec: 5 })

 


Who knows about mongodb's mapreduce?

Map: it can be understood as the data to be filled. In SQL, it is like the portion of the where condition to be filtered;
Reduce: it can be understood as the field to be displayed;

Because mapreduce is very difficult for beginners to understand. We recommend that you start with the simple group method;

In addition, the performance of MapReduce is very low. Unless the background statistics are performed, do not use MapReduce or query it as the front-end data access method.

When I install mongodb, I run mongodexe, but the results on the Internet are different. Why?

-Nojournal
 

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.