MongoDB is a cross-platform document-oriented database program. MongoDB is required for DCF and K4M.. It is classified as a NoSQL database program, MongoDB uses JSON-like documents with schemata. MongoDB is developed by MongoDB Inc.

You can install MongoDB in the following three ways:
  1. Use MongoDB documentation to install the MongoDB.
  2. Use MongoDB install script to install MongoDB, which has below procedure automated in the script. You can refer KB article from https://kb.vmware.com/s/article/70718 to download the script.
  3. Use below manual procedeure to install MongoDB.

Procedure

  1. Stop firewall on the server where MongoDB will be installed or open port 27017.
  2. Create a file /etc/yum.repos.d/mongodb-org-4.0.repo with the following content:
    [mongodb-org-4.0]
    name=MongoDB Repository
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
    gpgcheck=1
    enabled=1
    gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
  3. Install MongoDB, by invoking the command:
    yum install -y mongodb-org-4.0.4 mongodb-org-server-4.0.4 mongodb-org-shell-4.0.4 mongodb-org-mongos-4.0.4 mongodb-org-tools-4.0.4
  4. Start MongoDB service:
    service mongod start
  5. Create first user in MongoDB, by invoking the command:
    mongo admin --eval 'db.createUser({user: "admin",pwd: "changeme",roles: [ { role: "root", db: "admin" } ]})'
  6. Enable authentication in MongoDB, by invoking the command:
    vi /etc/mongod.conf
    security:
        authorization: "enabled"
  7. Restart MongoDB, by invoking command:
    service mongod restart