Navigation
This version of the documentation is archived and no longer supported. To learn how to upgrade your version of MongoDB Ops Manager, refer to the upgrade documentation.
You were redirected from a different version of the documentation. Click here to go back.

Start MongoDB Processes with Init Scripts

Overview

Ops Manager provides a tool to create init scripts that will run your MongoDB processes if you should decide to stop managing them through Automation. The tool creates scripts that can start your processes automatically upon boot up or that you can use to start the processes manually.

The tool is available when you install the Automation Agent using an rpm or deb package.

The “Make Init Scripts” Tool

When you install the Automation Agent using an rpm or deb package, the agent includes the following “Make Init Scripts” tool:

/opt/mongodb-mms-automation/bin/mongodb-mms-automation-make-init-scripts

The tool creates an init script for each mongod or mongos process on the server and has the following options:

Option Description
-boot Configures the init scripts to start the MongoDB processes on system boot. By default, the tool creates the scripts with this option disabled.
-cluster <string>

Specify the absolute path and filename of the local copy of the automation configuration only if the local copy does not use the default path and name, which are:

/var/lib/mongodb-mms-automation/mms-cluster-config-backup.json

The tool references the local copy of the configuration file to determine the desired state of the MongoDB processes.

-d <string>, -distribution <string> Specifies the Linux distribution. By default, the tool auto-detects the distribution. If this fails, specify your distribution as either debian or redhat.
-h, -help Describes the tool’s options.

Procedures

Remove Processes from Automation and Create Init Scripts

This procedure creates scripts for stopping and starting MongoDB processes and then removes the processes from Automation.

Perform this procedure on each server that runs processes you want to remove from Automation. If you are removing a replica set, perform this on each replica set member separately, which allows you to remove the set from Automation without downtime.

1

Create the init scripts.

To create the init scripts, run the mongodb-mms-automation-make-init-scripts tool with superuser access. It is recommended that you use the -boot option so that you configure the scripts to start the MongoDB processes on system boot. Otherwise, you will be responsible to manually start each script.

To run the tool with superuser access and with the -boot option, issue:

sudo /opt/mongodb-mms-automation/bin/mongodb-mms-automation-make-init-scripts -boot

The tool places the init scripts in the /etc/init.d directory and names each one using the following form:

(mongod|mongos)-<process-name>

<process-name> is the name given to the mongod or mongos process in the cluster configuration.

2

Shut down each process.

On the Ops Manager Deployment page, click the ellipsis icon for the process and select the option to shutdown. Deploy the changes. For detailed steps, see Shut Down a MongoDB Process.

3

Remove each process from Automation.

On the Ops Manager Deployment page, click the ellipsis icon for the process and select the option to remove it. Deploy the changes. For detailed steps, see Remove a Process from Management.

4

Uninstall the Automation Agent.

If you installed the agent with an rpm package, issue following:

sudo rpm -e mongodb-mms-automation-agent-manager

If you installed the agent with an deb package, issue following:

sudo apt-get remove mongodb-mms-automation-agent-manager
5

Start each MongoDB process using its init script.

Issue the following for each process:

sudo /etc/init.d/<script-name> start

Start or Stop a MongoDB Process using the Init Script

If you chose to run the “Make Init Scripts” tool without the -boot, then you must stop and start your MongoDB processes manually.

To start a MongoDB process using the init script, issue

sudo /etc/init.d/<script-name> start

To stop a MongoDB process using its init script, issue:

sudo /etc/init.d/<script-name> stop