Linux under MongoDB Service installation

Source: Internet
Author: User
Tags create mongodb

Linux under MongoDB Service installation

MongoDB is a database based on distributed file storage. Written by the C + + language. Designed to provide scalable, high-performance data storage solutions for Web applications. MongoDB is a product between a relational database and a non-relational database, and is the most versatile and most like relational database in a non-relational database. The data structure he supports is very loose and is a JSON-like Bson format, so you can store more complex data types. MONGO's biggest feature is that the query language he supports is very powerful, and its syntax is a bit like an object-oriented query language that almost implements most of the functionality of a relational database single-table query, and also supports indexing of data.

1. Download MongoDB, select Community Edition, Linux x64 version

wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.2.10.tgz

2. Start MongoDB using Mongod, the commonly used parameters are

DBPath Specifying the database path

LOGPATH Specifies the MongoDB log file, note that the specified file is not a directory

Logappend writing the log using the Append method

BIND_IP bind service IP, if bind 127.0.0.1, then only native access, do not specify default local all IP

Fork runs MongoDB as a daemon, creating a server process

Example, create a mongodb.conf with the following file contents:

Dbpath=. /data_noauth/

Logpath=. /log/mongodb_noauth.log

Logappend=true

bind_ip=127.0.0.1

Fork=true

Start Mongodb,./mongod–f./mongdb.conf, then run MongoDB as a daemon, but kill the MongoDB process, MongoDB service is not automatically open.

3. Using supervisor to start MongoDB, really protect the mongodb process, it is necessary to pay attention to the Mongod fork parameter cancellation, otherwise it will not play a guardian role. Create mongodb.conf under the/etc/supervisor/conf.d/folder:

[Program:mongodb]

Command=/data/mongodb/bin/mongod-f/data/mongodb/bin/mongodb.conf

directory=/data/mongodb/bin/

Autorestart=true

Restart Supervisor

/etc/init.d/supervisor restart

can use the MongoDB service normally.

Public Number: ludong86

Linux under MongoDB Service installation

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.