You are here: Manual Installation > Upgrading > Upgrading to MongoDB 3.2.x

2.19 Upgrading to MongoDB 3.2.x

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:

  1. 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
    
  2. Confirm that nothing is connected to MongoDB.

    [root]# netstat -antp | egrep '(27017|28017).*ESTABLISHED'
  3. 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.
  1. 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
  1. Restore the database.

    [root]# cd /root
    [root]# mongorestore
  2. 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
  1. 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
  2. Restart MongoDB.

    [root]# service mongod restart
  1. Follow the instructions to upgrade your Moab HPC Suite components.

© 2016 Adaptive Computing