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
To install MongoDB, enter the following command:
yum install rh-mongodb34 rh-mongodb34-syspaths
# yum install rh-mongodb34 rh-mongodb34-syspathsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the rh-mongodb34 service:
systemctl start rh-mongodb34-mongod systemctl enable rh-mongodb34-mongod
# systemctl start rh-mongodb34-mongod # systemctl enable rh-mongodb34-mongodCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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'}]})"# mongo pulp_database \ --eval "db.createUser({user:'pulp',pwd:'pulp_password',roles:[{role:'dbOwner', db:'pulp_database'},{ role: 'readWrite', db: 'pulp_database'}]})"Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the
/etc/opt/rh/rh-mongodb34/mongod.conffile, specify the bind IP:bindIp: your_mongodb_server_bind_IP,::1
bindIp: your_mongodb_server_bind_IP,::1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
/etc/opt/rh/rh-mongodb34/mongod.conffile to enable authentication in thesecuritysection:security: authorization: enabled
security: authorization: enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the
rh-mongodb34-mongodservice:systemctl restart rh-mongodb34-mongod
# systemctl restart rh-mongodb34-mongodCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open port 27017 for MongoDB:
firewall-cmd --add-port=27017/tcp firewall-cmd --runtime-to-permanent
# firewall-cmd --add-port=27017/tcp # firewall-cmd --runtime-to-permanentCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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"
# scl enable rh-mongodb34 " mongo --host mongo.example.com \ -u pulp -p pulp_password --port 27017 --eval 'ping:1' pulp_database"Copy to Clipboard Copied! Toggle word wrap Toggle overflow