- Manage Deployments >
- MongoDB Processes >
- Start MongoDB Processes with Init Scripts
Start MongoDB Processes with Init Scripts¶
On this page
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:
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:
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.
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:
The tool places the init scripts in the /etc/init.d
directory
and names each one using the following form:
<process-name>
is the name given to the mongod or
mongos process in the cluster configuration.
Shut down each process.¶
In the Ops Manager Deployment tab, 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.
Remove each process from Automation.¶
In the Ops Manager Deployment tab, 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.
Uninstall the Automation Agent.¶
If you installed the agent with an rpm
package, issue following:
If you installed the agent with an deb
package, issue following:
Start each MongoDB process using its init script.¶
Issue the following for each process:
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
To stop a MongoDB process using its init script, issue: