3.4. Installing MongoDB

You can install only the same version of MongoDB that is installed with the satellite-installer tool during an internal database installation. You can install MongoDB using Red Hat Software Collections (RHSCL) repositories or from an external source, as long as the version is supported. Satellite supports MongoDB version 3.4.

Procedure

  1. To install MongoDB, enter the following command:

    # yum install rh-mongodb34 rh-mongodb34-syspaths
  2. Start and enable the rh-mongodb34 service:

    # systemctl start rh-mongodb34-mongod
    # systemctl enable rh-mongodb34-mongod
  3. Create a Pulp user on MongoDB for database pulp_database:

    # mongo pulp_database \
    --eval "db.createUser({user:'pulp',pwd:'pulp_password',roles:[{role:'dbOwner', db:'pulp_database'},{ role: 'readWrite', db: 'pulp_database'}]})"
  4. In the /etc/opt/rh/rh-mongodb34/mongod.conf file, specify the bind IP:

    bindIp: your_mongodb_server_bind_IP,::1
  5. Edit the /etc/opt/rh/rh-mongodb34/mongod.conf file to enable authentication in the security section:

    security:
      authorization: enabled
  6. Restart the rh-mongodb34-mongod service:

    # systemctl restart rh-mongodb34-mongod
  7. Open port 27017 for MongoDB:

    # firewall-cmd --add-port=27017/tcp
    # firewall-cmd --runtime-to-permanent
  8. From Satellite Server, test that you can access the database. If the connection succeeds, the command returns 1.

    # scl enable rh-mongodb34 " mongo --host mongo.example.com \
    -u pulp -p pulp_password --port 27017 --eval 'ping:1' pulp_database"