1. MongoDB Start & Close

Source: Internet
Author: User
Tags mongodb server

The "former record" has recently been modified by the company system, borrowing the memory library to achieve rapid response. The company borrows the MongoDB database. Here is the note to learn to organize

From Start & Close, it's too easy to install.

    • MongoDB Boot
MongoDB Server startup (a bit similar to the PostgreSQL database startup method): Use the Mongod command. As for the start parameter, you can use Mongod--help. Mongod common parameters are as follows:--dbpath: Specifies the data directory. such as E:\mongodb\date\db. To determine whether the directory exists or not, create it.           Otherwise, the directory will be reported at startup without errors. --port: Specifies the port. The default is 27017. If the port is occupied by another process. Use this parameter to reassign the port to it.           In the server cluster--logpath: Specify the log file. --config: Configuration file. Equivalent to-f
    1. General Startup
>mongod--dbpath E:\mongodb\date\db--port 5566--logpath e:\mongodb\date\db\mongodb.log# Data directory for E:\MONGODB\DATE\DB ; Port: 5566
2. Start with a configuration file. Create a new configuration file (mongodb.conf)
DBPath = E:\mongodb\date\db#port = 5566--note borrowing #logpath =e:\mongodb\date\db\mongodb.log
Start the server
>mongod--config E:\mongodb\date\db\mongodb.conf #其中的--config can be replaced with-F.
This way to start a high-end atmosphere than the previous point bar.

Check if startup is successful

    • MongoDB off
1. Ctrl + C way rough, simple, fast 2. Command mode
Use admin; #只有admin用户才有权限. Use username. is the command to switch users. Db.shutdown.server ();
3. Kill the Process
Ps-ef | grep Mongodb;kill PS
This is a simple way. But not safe. If the data is being written at that time, it will result in data loss.

1. MongoDB Start & Close

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.