Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mlaunch control center #148

Closed
rueckstiess opened this issue Jan 9, 2014 · 4 comments
Closed

mlaunch control center #148

rueckstiess opened this issue Jan 9, 2014 · 4 comments

Comments

@rueckstiess
Copy link
Owner

use different sub-commands for mlaunch. The default is start and can be ommited, so that mlaunch remains backwards compatible. Other sub-commands are restart, stop, list.

mlaunch start --sharded 4 --replicaset --nodes 2 --arbiter
mlaunch start --single
mlaunch --single

The list sub-command will show all the processes involved in the current --dir (not all globally running mongo processes).

move the --restart flag to sub command:

mlaunch restart

it will restart all the nodes that are currently not running.

mlaunch stop

will stop everything.

Proposal to target individual processes:

commands that only work with --replicaset

mlaunch stop --primary       (stop the primary)
mlaunch stop --secondary all  (stop both secondaries)
mlaunch stop --secondary x (stop only the x-th secondary)
mlaunch stop --arbiter  (stop arbiter)

commands that only work with --sharded

mlaunch stop --shard all |  x       (stop all shards / nodes of shard x)
mlaunch stop --config  all | x       (stop all / x-th config server)
mlaunch stop --mongos all | x     (stops all / x-th mongos)

Use the same notation for mlaunch restart.

@rueckstiess
Copy link
Owner Author

This ticket is the super-ticket of #140, #28, #53, #87.

@rueckstiess
Copy link
Owner Author

Also need to store a cluster configuration in the .mlaunch_startup file, for example:

{ 'single' : 27017 }

{ 'replicaset' : {
    'primary': 27017, 
    'secondaries': [ 27018, 27019 ], 
    'arbiters': [ 27020 ] }
}

{ 'sharded' : { 
    'config': [ 27034, 27035, 27036 ],
    'mongos': [ 27017, 27018 ],
    'shards': [
        {
            'primary': 27019, 
            'secondaries': [ 27020, 27021 ], 
            'arbiters': [ 27022, 27023 ]
        }, 
        {
            'primary': 27024, 
            'secondaries': [ 27025, 27026 ], 
            'arbiters': [ 27027, 27028 ]
        }, 
        {
            'primary': 27019, 
            'secondaries': [ 27030, 27031 ], 
            'arbiters': [ 27032, 27033 ]
        }
    ] }
}

@rueckstiess
Copy link
Owner Author

completely rewritten mlaunch. It now supports sub-commands init (default, can be omitted), start, stop, list. The usage is 100% backwards compatible. For example:

mlaunch --sharded 2 --single --mongos 2
mlaunch init --sharded 2 --single --mongos 2

These are the same. Additionally, nodes can be started, stopped, and listed, like so:

mlaunch list
mlaunch start [tags ...]
mlaunch stop [tags ...]

Tags can be a lot of different things, like mongos, config, shard, primary, secondary, running, down, all, individual port numbers, shard names, ...

Some tags can have a number following the tag. If there is a number, e.g. n, only the n-th of that tag is affected.

If no tags are provided, all nodes are affected by the command. Each tag narrows down the set of nodes affected (tags are logically ANDed = set intersection).

For example:

To stop all primaries:

mlaunch stop primary

To stop all nodes from shard 2:

mlaunch stop shard 2

To stop all mongod (but not mongos):

mlaunch stop mongod

To stop the 3rd config server:

mlaunch stop config 3

To stop the first secondary of each shard:

mlaunch stop secondary 1

To stop an individual node running on port 27018:

mlaunch stop 27018

The change is pushed to the repo under branch feature-148-controlcenter for testing.

@rueckstiess
Copy link
Owner Author

implemented for version 1.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant