1, download & install
MongoDB provides the CentOS Yum installation method.
Reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/
PDF Brochure:
Http://docs.mongodb.org/manual/MongoDB-manual.pdf
Vi/etc/yum.repos.d/mongodb-org-3.0.repo
[mongodb-org-3.0]name=MongoDB Repositorybaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/gpgcheck=0enabled=1
Installing MongoDB
-y mongodb-org
All related services are installed.
...... Running Transaction Installing:mongodb-org-shell-3.0.2-1.el7. x86_641/5 Installing:mongodb-org-tools-3.0.2-1.el7. x86_642/5 Installing:mongodb-org-mongos-3.0.2-1.el7. x86_643/5 Installing:mongodb-org-server-3.0.2-1.el7. x86_644/5 Installing:mongodb-org-3.0.2-1.el7. x86_645/5 Verifying:mongodb-org-3.0.2-1.el7. x86_641/5 Verifying:mongodb-org-server-3.0.2-1.el7. x86_642/5 Verifying:mongodb-org-mongos-3.0.2-1.el7 .x86_64 3/5 verifying:mongodb< Span class= "Hljs-attribute" >-org-tools- 3.0.2- 1.el7.x86_64 4/5 Verifying: Mongodb-org-shell-3.0.2-1.el7< Span class= "hljs-built_in" >.x86_64 5/5
Configuration files in:/etc/mongod.conf
Data files in:/var/lib/mongo
Log files in:/var/log/mongodb
2, configure the port number of the. conf
Note: After the mongodb3.x version is the configuration file to YAML syntax format, the following is the YAML configuration file format as follows:
Official Yaml Profile Options reference: https://docs.mongodb.org/manual/... #configuration-file
You can only use spaces, do not support the TAB key, remember, and "Colon" is also a space behind
In order for the local visualizer to view the MONGDB database, you first need to change the port number
Vim/etc/mongod.conf
Operating instructions under the 3,service
MongoDB Service Usage
#启动service mongod start#停止service mongod stop#重启service mongod restart#增加开机启动chkconfig mongod on
4, Start | Enable authentication (also configured in. conf files)
Security:authorization:disabled
5, set the user
First, you create a super administrator when you do not have permission authentication turned on.
MongoDB Full Configuration