How to Install MongoDB 3.2 in CentOS 6.5 or Redhat Enterprise Linux?
Installation of MongoDB 3.2 in CentOS is very easy. You can follow following steps and you are done. First of all you make sure your platform architecture is 32 bit or 64 bit, basis on that you can proceed. Your installation platform is on 32 bit or 64 bit OS ,it is important to know before installation.
1. Configure yum package
logged in into linux system using putty or another one. and create a file with folliwing command
Paste following in the file.
[mongodb-org-3.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ gpgcheck=0 enabled=1
2. Install MongoDB packages and it’s associated tools
run following command
sudo yum install -y mongodb-org
3. Start MongoDB process
You can start the mongod process by issuing the following command:
sudo service mongod start
4. Verify mongod process
ps -ef | grep mongod
or You can verify that mongod process has started successfully by checking the contents of the log file at
/var/log/mongodb/mongod.log or run following command.
tail -100f /var/log/mongodb/mongod.log
5. Stop MongoDB
You can stop the mongod process by issuing following command:
sudo service mongod stop
6. Restart MongoDB
In restart, if running mongod process then first stop and then start.
sudo service mongod restart
7. Run Mongo client
[root@ranjeet ~]# mongo MongoDB shell version: 3.0.7 connecting to: test Server has startup warnings: 2015-10-30T19:07:08.570+0530 I CONTROL [initandlisten] 2015-10-30T19:07:08.571+0530 I CONTROL [initandlisten]
if connecting to: test display in above it mean mongoDB 3.2 successfully installed. 🙂
Your comment is welcome to improve this post.