MemSQL Ops Command Line Interface


As of MemSQL 6.7, MemSQL Ops is a deprecated tool. You are encouraged to use the new MemSQL management tools for future deployments. See the installation guides for more details on how to deploy and manage a cluster using the new management tools.

MemSQL Ops provides a command line interface (CLI) for MemSQL management and monitoring. CLI commands can be run using the memsql-ops prefix on a host with a MemSQL Ops installed.

MemSQL Ops commands were designed to be composable. The command line interface was optimized for scripting MemSQL deployments. For example, this command will SSH into all MemSQL leaf nodes part of the MemSQL Ops cluster and print ‘foobar’.

memsql-ops agent-ssh --multi --memsql-role=leaf -- 'echo foobar'

You can also create more complicated commands like the one shown below. This command will deploy MemSQL leaf nodes into all hosts with MemSQL Ops follower agents deployed.

memsql-ops agent-list -q -r follower | xargs -n 1 memsql-ops memsql-deploy -r leaf

The command above will first list MemSQL Ops follower agent ids, then deploy MemSQL leaf nodes into each of them.

You will notice some commands take positional arguments (i.e. the command can execute against multiple entities), and some only take one argument (i.e. the command can only execute against one entity at a time). This is intentional. For operations where being able to rollback matters, we mandate that these be done in a serialized manner. An example of which is memsql-deploy in the first code snippet above. For operations where rollback is not crucial, such as agent-ssh, we allow having positional arguments and thus running commands in a parallelized way.

Finally, the MemSQL Ops command line interface is also robust. You may notice that in situations where user input to memsql-ops is incomplete, Ops will display a list of options and prompt the users for a choice.

See the sections below for full descriptions and syntax for each MemSQL Ops agent operation.

Was this article useful?