MongoDB

From SME Server
Revision as of 12:51, 9 February 2019 by Jader (talk | contribs) (MongoDB installation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump 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

and 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