Install and uninstall Mongodb databases on centos 7

Source: Internet
Author: User

Install and uninstall Mongodb databases on centos 7
MongoDB is a distributed file storage-based database. Written in C ++. It is designed to provide scalable, high-performance data storage solutions for WEB applications. MongoDBMongoDB is a product between relational databases and non-relational databases. It features the most abundant and most like relational databases. The supported data structure is very loose and is similar to the json bson format, so it can store more complex data types. The biggest feature of Mongo is that it supports a very powerful query language. Its syntax is somewhat similar to an Object-Oriented Query Language. It can almost implement most of the functions similar to single-table queries in relational databases, it also supports data indexing. This document is summarized on the official website.1. Install 1. Configure the yum source of the system.

Cd/etc/yum. repo. d/touch mongodb-org-3.4.repovi mongodb-org-3.4.repo # Add the following content [mongodb-org-3.4] name = MongoDB Repositorybaseurl = repository!

2. Install MongoDB online using yum

Sudo yum install-y mongodb-org # install the mongodb-org package and its dependent packages mongodb-org-server, mongodb-org-mongos, mongodb-org-shell, and mongodb. -org-tools

3. Disable selinux.

Sed-I's/SELINUX = enforcing/SELINUX = disabled/G'/etc/selinux/config # You need to restart the server to take effect. setenforce 0 # Temporarily takes effect. Restarting the server is invalid.

4. Disable the firewall or open ports

Systemctl stop firewalld # disable the firewall or open the port number firewall-cmd -- zone = public -- add-port = 27017/tcp # mongodb default port number firewall-cmd -- reload # reload the firewall

5. Enable MongoDB

Sudo service mongod start # enable MongoDBsudo chkconfig mongod on # Add to boot and start sudo service mongod restart # restart MongoDB
 

6. Disable MongoDB

Sudo service mongod stop # disable Firewall

7. Uninstall MongoDB

Sudo yum erase $ (rpm-qa | grep mongodb-org) # uninstall MongoDBsudo rm-r/var/log/mongodb # Delete the log file sudo rm-r/var/lib/mongo # Delete the data file

8. Check whether the database is successfully installed.

Ps-aux | grep mongod # Check whether the database process exists

9. Recommended MongoDB commands

http://www.cnblogs.com/JeremyWYL/p/7809318.html

Just Do It

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.