Skip to content

mlaunch

Thomas Rueckstiess edited this page Sep 9, 2013 · 30 revisions

mlaunch

Required Parameters

mlaunch requires exactly one of the following parameters to run: --single, --replicaset, --restart. They are mutually exclusive and one must be specified for each mlaunch execution.

Single Node

--single
This parameter will create a single stand-alone node. If --sharded is also specified, this parameter will create each shard as a single stand-alone node.

Example
mlaunch --single

This command would start a single mongod instance on port 27017.


###### Replica Set `--replicaset`
This parameter will create a replica set rather than a single node. Other [replica set parameters](./mlaunch#replica-set-parameters) apply and can modify the properties of the replica set to launch. If `--sharded` is also specified, this parameter will create one such replica sets for each shard.
Example
mlaunch --replicaset

This command would start a replica set with (by default) 3 nodes on ports 27017, 27018, 27019.


###### Restart `--restart`, `--restore`
Either of these options will search for a `.mlaunch` directory under the given "`--dir`" directory (by default `./data`, see [Data Directory](./mlaunch#data-directory). This is where **mlaunch** stores information about previous setups. If such a directory exists, **mlaunch** will restart the same setup as before. This is useful if you need to tear down and bring up the same environment multiple times.

General Parameters

Help

-h, --help
shows the help text and exits.

Version

--version
shows the version number and exits.

Verbosity

--verbose
prints how each of the instances was launched.

Start Port

--port PORT
Uses PORT as the start port number for the first instance, and increases the number by one for each additional instance (mongod/mongos). By default, the start port value is MongoDB's standard port 27017. Use this parameter to start several setups in parallel on different port ranges.

Example
mlaunch --replicaset --nodes 3 --port 30000

This command would start a replica set of 3 nodes using ports 30000, 30001 and 30002.


###### Authentication `--authentication`
This parameter enables authentication on your setup. It will both work with single instances (`--auth`) as well as replica sets and sharded environments (`--keyFile`). There is no need to additionally specify a keyfile, a random keyfile will be generated for you.
Binary Path

--binarypath PATH
Will set the path where mlaunch looks for the binaries of mongod and mongos to the provided PATH. By default, the PATH environment variable is used to determine which binary is started. You can use this option to overwrite the default setting. This is useful for example if you compile your own source code and want mlaunch to use the compiled version.

Example
mlaunch --single --binarypath ./build/bin

This command will look for the mongod binary in ./build/bin/mongod instead of the default location.


###### Data Directory `--dir DIR`
This parameter changes the directory where **mlaunch** stores its data and log files. By default, the directory is the local directory `./data`, below the current working directory.
Clone this wiki locally