ltcluster service status

ltcluster service status — display information about the status of ltclusterd on each node in the cluster

Description

This command provides an overview over all active nodes in the cluster and the state of each node's ltclusterd instance. It can be used to check the result of ltcluster service pause and ltcluster service unpause operations.

Prerequisites

LightDB should be accessible on all nodes (using the conninfo string shown by ltcluster cluster show) from the node where ltcluster service status is executed.

Execution

ltcluster service status can be executed on any active node in the replication cluster. A valid ltcluster.conf file is required.

If a node is not accessible, or LightDB itself is not running on the node, ltcluster will not be able to determine the status of that node's ltclusterd instance, and "n/a" will be displayed in the node's ltclusterd column.

Note

After restarting LightDB on any node, the ltclusterd instance will take a second or two before it is able to update its status. Until then, ltclusterd will be shown as not running.

Examples

ltclusterd running normally on all nodes:

$ ltcluster -f /etc/ltcluster.conf service status
 ID | Name  | Role    | Status    | Upstream | ltclusterd | PID   | Paused? | Upstream last seen
----+-------+---------+-----------+----------+---------+-------+---------+--------------------
 1  | node1 | primary | * running |          | running | 96563 | no      | n/a
 2  | node2 | standby |   running | node1    | running | 96572 | no      | 1 second(s) ago
 3  | node3 | standby |   running | node1    | running | 96584 | no      | 0 second(s) ago

ltclusterd paused on all nodes (using ltcluster service pause):

$ ltcluster -f /etc/ltcluster.conf service status
 ID | Name  | Role    | Status    | Upstream | ltclusterd | PID   | Paused? | Upstream last seen
----+-------+---------+-----------+----------+---------+-------+---------+--------------------
 1  | node1 | primary | * running |          | running | 96563 | yes     | n/a
 2  | node2 | standby |   running | node1    | running | 96572 | yes     | 1 second(s) ago
 3  | node3 | standby |   running | node1    | running | 96584 | yes     | 0 second(s) ago

ltclusterd not running on one node:

$ ltcluster -f /etc/ltcluster.conf service status
 ID | Name  | Role    | Status    | Upstream | ltclusterd     | PID   | Paused? | Upstream last seen
----+-------+---------+-----------+----------+-------------+-------+---------+--------------------
 1  | node1 | primary | * running |          | running     | 96563 | yes     | n/a
 2  | node2 | standby |   running | node1    | not running | n/a   | n/a     | n/a
 3  | node3 | standby |   running | node1    | running     | 96584 | yes     | 0 second(s) ago

Options

--csv

ltcluster service status accepts an optional parameter --csv, which outputs the replication cluster's status in a simple CSV format, suitable for parsing by scripts, e.g.:

    $ ltcluster -f /etc/ltcluster.conf service status --csv
    1,node1,primary,1,1,5722,1,100,-1,default
    2,node2,standby,1,0,-1,1,100,1,default
    3,node3,standby,1,1,5779,1,100,1,default

The columns have following meanings:

  • node ID
  • node name
  • node type (primary or standby)
  • LightDB server running (1 = running, 0 = not running)
  • ltclusterd running (1 = running, 0 = not running, -1 = unknown)
  • ltclusterd PID (-1 if not running or status unknown)
  • ltclusterd paused (1 = paused, 0 = not paused, -1 = unknown)
  • ltclusterd node priority
  • interval in seconds since the node's upstream was last seen (this will be -1 if the value could not be retrieved, or the node is primary)
  • node location

--detail

Display additional information (location, priority) about the ltcluster configuration.

--verbose

Display the full text of any database connection error messages.

See also

ltcluster service pause, ltcluster service unpause, ltcluster cluster show, pausing the ltclusterd service, ltcluster daemon start, ltcluster daemon stop