web analytics

Install mongodb – Centos/RHEL/Fedora

Install mongodb in CentOS

Depending on the architecture, add the mongo repo to your system.

1)First find if your machine is 32 bit or 64 bit as follows.

uname -m

i686 – it is 32 bit
x86_64 – it is 64 bit.

2) Create the mongo repo as follows.

# vi /etc/yum.repos.d/10gen.repo

If it is 32bit machine, add the following to the file.

name=10gen Repository

If it is a 64bit machine, use the following.

name=10gen Repository


3) Now you can use yum to install mongo.

yum install mongo-10gen mongo-10gen-server

Mongo is now installed and you can start and stop mongo as follows.

/etc/rc.d/init.d/mongod start
/etc/rc.d/init.d/mongod stop

4) The configuration file for mongo is present at /etc/mongod.conf

5) The data directory can be mentioned in the configuration file. By default, it resides at /var/lib/mongo/

One comment to Install mongodb – Centos/RHEL/Fedora

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>