[HowTo] Install MongoDB 4.0 on VestaCP with Centos 7/RHEL 7
[HowTo] Install MongoDB 4.0 on VestaCP with Centos 7/RHEL 7
Step 1
Adding MongoDB 4.0 Repository :
Create repo file :
Now add this lines to mongodb4.repo :
Save and exit
Step 2
Installing MongoDB 4.0 :
If you’ve enabled selinux you need to run this command in order to give access :
*use this command if you’re using enforcing mode
Step 3
Verify the installation and enable startup :
Start MongoDB Service :
To restart and stop MongoDB Service :
you need to run this command from command line in order to access mongo db CLI interface :
To enable mogodb start automatically during os boot :
Adding MongoDB 4.0 Repository :
Create repo file :
Code: Select all
yum install nano -y
nano /etc/yum.repos.d/mongodb4.repo
Code: Select all
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
Step 2
Installing MongoDB 4.0 :
Code: Select all
yum install -y mongodb-org
Code: Select all
semanage port -a -t mongod_port_t -p tcp 27017
Step 3
Verify the installation and enable startup :
Start MongoDB Service :
Code: Select all
service mongod start
Code: Select all
service mongod restart
service mongod stop
Code: Select all
mongo
Code: Select all
systemctl enable mongod