Saturday, June 17, 2017

Linux: Install MongoDB on CentOS 7

1. Update the system.

yum update




2. Create a repo file. 

vi /etc/yum.repos.d/mongodb-org-3.4.repo




add this code below and save it.

[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc



3. Install mongodb.

yum install -y mongodb-org



press y to add gpg key


4. Configure mongodb.

vi /etc/selinux/config



Edit selinux to disabled or permissive.

selinux to be permissive

service mongod start

chkconfig mongod on



No comments:

Post a Comment