CentOS7 on MongoDB Install, uninstall

Source: Internet
Author: User
Tags install mongodb

Reference official website https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

First, installation

1. Configuring the Yum Management Pack

1), create the file under Path/etc/yum.repos.d/Mongodb-org-3.4.repo

cd/etc/yum.repos.d/

Touch Mongodb-org-3.4.repo

2), write the following in the file Mongodb-org-3.4.repo

  [mongodb-org-3.4]

  Name=MongoDB Repository

  BaseURL=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/

Gpgcheck=1

Enable=1

  Gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc

2. Install MongoDB (Install mongodb-org package and its dependent packageMongodb-org-server,Mongodb-org-mongos,Mongodb-org-shell,mongodb-org-tools

< Span class= "s" > db instance default in/var/lib/mongo path, log default in/var/log/ MongoDB path, you can also configure by modifying the Storage.dbpath and Systemlog.path of the/etc/mongod.conf file

Yum Install-y mongodb-org

3. Open MongoDB Service

Service Mongod Start

4, check the log mode, verify that the service opened successfully, which has a behavior: [Thread1] waiting for connections on port 27017

Cat/var/log/mongodb/mongod.log

5. Set Boot start

Chkconfig Mongod on

6. Stop MongoDB Service

Service Mongod Stop

7. Restart MongoDB Service

Service Mongod Restart

Second, uninstall

1. Stop the Service

Service Mongod Stop

2. Remove Installed Packages

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

3. Delete data and logs

Rm-r/var/log/mongodb

Rm-r/var/lib/mongo

CentOS7 on MongoDB Install, uninstall

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.