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