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