Child pages
  • Running MongoDB on the SICE Unified Linux Systems

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  1. Log into the burrow server (, aka using ssh, PuTTY, or some other SSH client.  All of the following steps must be done while logged into the burrow server.
  2. Create a directory in your homedir to save the needed files.  In this example we will use a mongodb directory.

    Code Block
    mkdir /u/username/mongodb
  3. Copy in the default mondod configuration file into this directory

    Code Block
    cp /etc/mongod.conf /u/username/mongodb/mongod.conf
  4. Edit the /u/username/mongodb/mongodb.conf file, making the following changes:


    • Change the paths for pidfilepath, logpath, unixSocketPrefix, and dbpath from things like /var/run/mongodb/ to /u/username/mongodb/  You must make sure that you have no paths that point into /var/...
    • Uncomment the port line and change the port number from the default (27017) to some other random port that must be greater than 10,000.  You can use the checkport command to check if a port is available.  For example, if you wanted to use port 12233 then run "checkport 12233" to verify that it is available.

  5. Start the daemon with:

    Code Block
    mongod --config /u/username/mongodb/mongod.conf

    We have a newer mongo 3.2 installed that you can use.  If you want to use this version instead of the default, just run ". /opt/rh/rh-mongodb32/enable" (that's a '.' followed by the filename) before you start mongod.  You can run "which mongod" to confirm which version you are running.

  6. Connect to the database server:

    Code Block
    mongo localhost:12345

    You must replace 12345 with the unique port number you assigned in the mongodb.conf file (from step 4)

  7. The default configuration will only allow connections from silo itself via what is called localhost.  If you need to make remote connections (say, from a cgi or php script) then you will need to make a change to your mongod.conf file.  You will have to change the line "bind_ip=" to "bind_ip=" and restart your server.  Then, you can use a server connect string like the following:

    Code Block

    As above, you will need to replace 12345 with the proper port number.


    If you configure mongodb to listen on the network, you must configure authentication.  Leaving a mongodb server up on the network with no authentication is leaving the service ripe for abuse and is against IU and SoIC policy.  Please see the MongoDB Security Checklist for more information.