MongoDB

From SME Server
Jump to navigation Jump to search

How to install MongoDB 4.0

Install Official Repository

db yum_repositories set mongodb repository \
               BaseURL https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/4.0/x86_64/ \
               EnableGroups no \
               GPGCheck yes \
               Name "MongoDB" \
               GPGKkey https://www.mongodb.org/static/pgp/server-4.0.asc \
               Visible no \
               status disabled
signal-event yum-modify
yum install mongodb-org --enablerepo=mongodb

If refuses to install because o GPG Key you can change GPGCheck above from Yes to No and try yum install... again or

yum install mongodb-org --enablerepo=mongodb --nogpgcheck

Start Mongo

/etc/init.d/mongod start

Add the symlinks to start automatically:

ln -s /etc/init.d/mongod /etc/rc.d/rc6.d/K03mongodb
ln -s /etc/init.d/mongod /etc/rc.d/rc7.d/S57mongodb

Optional: create symlink to use mongo or mongodb as service name

ln /etc/init.d/mongod /etc/init.d/mongodb

To ensure everything is all right:

signal-event post-upgrade
signal-event reboot