MongoDB Database Installation and uninstallation

Source: Internet
Author: User
Tags install mongodb

Here is an example of installing CentOS monggodb3.4 version, which can be found in the website installation tutorial

The steps are as follows:

1. Configuring MongoDB ym Source

vi/etc/yum.repos.d/mongodb-org-3.4. Repo

The contents of the file are:

[mongodb-org-3.4]name 3.4 repositorybaseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64 /gpgcheck=0Enabled=1

2. Implement Yum to install MongoDB

Yum Install-y mongodb-org

The Mongdb configuration file is generated when the installation is successful:/etc/mongo.conf

3. Start MongoDB

Service Mongod Start

4. Verify the MongoDB boot status

Look at the MongoDB log file to see if you have the following output:

 for connections on port <port>

mongodb 日志文件默认为/var/log/mongodb/mongod.log,可在配置文件(/etc/mongo.conf)进行修改

5. Configure boot-up

Execute the following statement:

Chkconfig Mongod on

To this MongoDB installation complete

Here are a few instructions:

Close mongdb:

Service Mongod Stop

Restart MongoDB (requires a restart after modifying the configuration file)

Service Mongod Restart

The client connects to MongoDB, by default, Mongdb listens only to local Area connection (127.0.0.1), the default port is: 27017

MONGO--host <ip>:<port>

Below is a description of the following MongoDB uninstallation steps:

1. Deactivate MONGDB Service:

Service Mongod Stop

2. Delete MongoDB installation files

Yum Erase $ (rpm-qa | grep mongodb-org)

3, delete mongdb database and log file (specific file directory can view the configuration file)

Rm-r/var/log/-R/var/lib/mongo

MongoDB Database Installation and uninstallation

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.