The LogDevice shell is the standard administrative tool for LogDevice
clusters, the tool offers two modes of operation, a CLI mode where you pass
the commands to
ldshell as arguments to execute and exit. Another mode is the
interactive mode where you start ldshell connected to a cluster without
passing a command, this will drop you into an interactive shell where you can
execute consecutive commands and get dynamic help and auto-completion of
commands, and arguments along the way.
LDShell is built on top of Facebook's
In order to use ldshell with a LogDevice cluster, you will need the location of
the configuration file handy. This can be a local config file or a zookeeper
path if you store the config file there. You can also start ldshell in a
"disconnected" mode by not supplying any arguments. This will start the
interactive mode where you can use the
connect command to establish a
connection to a running cluster. The
connect command takes the configuration
path similar to what you would pass in
ldshell -c <config-path>
# If the configuration file is local ldshell -c /tmp/my-logdevice-config.conf # If the configuration is on zookeeper ldshell -c zk:184.108.40.206:2181,220.127.116.11:2181/test_logdevice_cluster.conf
In interactive mode you use use the LogsConfig commands and ldshell will be helping out with auto-completion and syntax highlighting.
A couple of handy tips, you can exit by "q", "quit", or "Ctrl+D".
Using LDQuery from LDShell
LogDevice comes with a SQL-like query interface to query the internal state of the various components of the system. This system is called LDQuery and the interface for using this is LDShell "query" command.
LDQuery via CLI mode
ldshell -c zk:18.104.22.168:2181,22.214.171.124:2181/test_logdevice_cluster.conf query "SELECT * FROM info"
LDQuery via Interactive mode
ldshell -c zk:126.96.36.199:2181,188.8.131.52:2181/test_logdevice_cluster.conf asoli@zk:184.108.40.206:2181,220.127.116.11:2181/test_logdevice_cluster.conf> SELECT * FROM info ...