(Click to open topic with navigation)
Moab HPC Suite 9.1.0 and after requires MongoDB 3.2.x.
In order to upgrade the MongoDB databases, you must stop all services first. These instructions assume that you have all the MongoDB databases on the same host (for example, the Database Host). If you have installed the MongoDB databases on separate hosts (for example, the Insight MongoDB on the Insight Server Host), you will have to go to each host to stop the services before you can upgrade any of the MongoDB databases.
Do the following:
Stop all the services that use MongoDB. See the warning at the beginning of this topic.
[root]# service nitro-web-services stop # If Nitro Web Services is part of your configuration [root]# service tomcat stop # If MWS is part of your configuration [root]# service insight stop # If Insight is part of your configuration [root]# service moab stop
Confirm that nothing is connected to MongoDB.
[root]# netstat -antp | egrep '(27017|28017).*ESTABLISHED'
Dump the database.
[root]# cd /root [root]# mongodump -u admin_user -p secret1 [root]# cp -a dump dump.save [root]# rm -rf dump/admin/system.users.* # Cannot restore users.
Install MongoDB 3.2.x.
[root]# service mongod stop [root]# chkconfig mongod off [root]# cat > /etc/yum.repos.d/mongodb-org-3.2.repo <<'EOF' [mongodb-org-3.2] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc EOF [root]# rpm -e --nodeps $(rpm -qa 'mongo*') [root]# rm -rf /tmp/mongo*.sock /var/run/mongo* /var/lib/mongo* /var/log/mongo* [root]# yum install mongodb-org [root]# chkconfig mongod on [root]# service mongod start
Restore the database.
[root]# cd /root [root]# mongorestore
Create the users.
The "admin_user" is required. All other users are required only for the products that are part of your system configuration. For example, if Nitro Web Services is not part of your confirmation, you do not need to add the "nitro_user".
[root]# mongo use admin db.createUser({"user": "admin_user", "pwd": "secret1", "roles": ["root"]}) use moab db.createUser({"user": "moab_user", "pwd": "secret2", "roles": ["dbOwner"]}) db.createUser({"user": "mws_user", "pwd": "secret3", "roles": ["read"]}) db.createUser({"user": "insight_user", "pwd": "secret4", "roles": ["read"]}) use mws db.createUser({"user": "mws_user", "pwd": "secret3", "roles": ["dbOwner"]}) use insight db.createUser({"user": "insight_user", "pwd": "secret4", "roles": ["dbOwner"]}) db.createUser({"user": "mws_user", "pwd": "secret3", "roles": ["read"]}) use nitro-db db.createUser({"user": "nitro_user", "pwd": "secret5", "roles": ["dbOwner"]}) exit
Set MongoDB Configuration Options.
By default, /etc/mongod.conf sets net.bindIp to 127.0.0.1. You will need to change this setting if the MongoDB server needs to be accessible from other hosts or from other interfaces besides loopback. See https://docs.mongodb.com/manual/reference/configuration-options/#net-options for more information.
# Sample /etc/mongod.conf file net: port: 27017 # bindIp: 127.0.0.1 processManagement: fork: true pidFilePath: /var/run/mongodb/mongod.pid security: authorization: enabled storage: dbPath: /var/lib/mongo journal: enabled: true systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log
Restart MongoDB.
[root]# service mongod restart