solidDB Help : solidDB reference : solidDB ADMIN COMMAND syntax : GRID
  
GRID
Note Check the solidDB Release Notes for any limitations that are associated with using a grid in the current release.
ADMIN COMMAND 'grid [option]'
Runs commands on a grid where option is one of the following values:
commands (abbreviation cmds): Lists the options that you can use with the 'grid' command.
allowraftleadership: Allows a grid node to offer itself as a candidate for grid leader.
nodeinfo [node][rafts][repinfo][raftlog][nodes][json] (abbreviation ni): Returns information about the grid nodes.
nodeinfo alone prints the information that is equivalent to including the node, rafts, repinfo, and raftlog arguments.
If you include the node argument, the command returns the node ID, name and grid membership state. For example:
solsql> admin command 'grid ni node';
  RC TEXT
  -- ----
  0 1 GNODE_1 MEMBER_ONLINE
  1 rows fetched
If you include the rafts argument, the command returns the consensus algorithm membership state and details about the last two consensus algorithm log entries. For example:
solsql> admin command 'grid ni rafts';
  RC TEXT
  -- ----
  0 RAFT_STATE_LEADER
  0 Current :term=1, index=217, commit index=217
  0 Previous :term=1, index=216
  3 rows fetched
If you include the repinfo argument, the command returns the status of replication subscriptions from other nodes in the grid. For example:
solsql> admin command 'grid ni repinfo';
  RC TEXT
  -- ----
  0 SYS_GRID_SUBSCRIPTION_TCP__2323_4 ACTIVE
  0 SYS_GRID_SUBSCRIPTION_TCP__3323_8 ERROR
  0 SYS_GRID_SUBSCRIPTION_TCP__4323_12 ERROR
  3 rows fetched
If you include the raftlog argument, the command returns the index of the last command that was applied to the consensus algorithm log, and the index of the last committed log entry. For example:
solsql> admin command 'grid ni raftlog';
  RC TEXT
  -- ----
  0 RAFT_LOGINDEX 217 RAFT_COMMIT_INDEX 217
  1 rows fetched
If you include the nodes argument, the command returns the node id, name, grid membership state, connect string, and consensus algorithm membership state for all nodes in the grid. For example:
solsql> admin command 'grid ni nodes';
  RC TEXT
  -- ----
  0 1 GNODE_1 MEMBER_ONLINE (tcp 1323) Leader
  0 2 GNODE_2 MEMBER_ONLINE (tcp 2323) Follower
  0 3 GNODE_3 MEMBER_ONLINE (tcp 3323) Follower
  0 4 GNODE_4 MEMBER_ONLINE (tcp 4323) Follower
4 rows fetched.
If you include the json argument, the command prints the output in json format. For example:
solsql> admin command 'grid ni json';
  RC TEXT
  -- ----
  0 {"Nodeinfo":[
 0 {"node":[{"id":"1","name":"GNODE_1","state":"MEMBER_ONLINE"}]},
  0 {"RaftState": [{"state":"RAFT_STATE_LEADER","term":"1","index":"217","prevTerm":"1","commitIndex":"217"}]},
  0 {"subscriptions":[
  0 {"subscription":[{"name":"SYS_GRID_SUBSCRIPTION_TCP__2323_4","state":"ACTIVE"}]},
  0 {"subscription":[{"name":"SYS_GRID_SUBSCRIPTION_TCP__3323_8","state":"ERROR"}]},
  0 {"subscription":[{"name":"SYS_GRID_SUBSCRIPTION_TCP__4323_12","state":"ERROR"}]}]},
  0 {"raftlog":[{"RAFT_LOGINDEX":"217","RAFT_COMMIT_INDEX":"217"}]}]}
8 rows fetched.
raftstate (abbreviation rst): Returns the consensus algorithm state of the grid. For example:
solsql> admin command 'grid raftstate';
  RC TEXT
  -- ----
  0 RAFT_STATE_LEADER
  1 rows fetched.
restart (abbreviation rs): Completes the following steps:
ensures that all members of the grid have connected with each other,
sets the node (where the command is executed) to be the leader,
allows every other node to be a candidate (so that any other node can become the leader if the current leader fails).
For example:
solsql> admin command 'grid restart';
  RC TEXT
  -- ----
  0 Global
  0 ----
  0 tcp 1323
  0 Tried to allow Leadership for the Raft but it is already allowed
  0 ----
  0 tcp 2323
  0 Succeeded to allow Leadership for the Raft
  0 ----
  0 tcp 3323
  0 Succeeded to allow Leadership for the Raft
13 rows fetched.
state (abbreviation sta): Returns the state of the grid. For example:
solsql> admin command 'grid state';
  RC TEXT
  -- ----
  0 LEADER ONLINE
  1 rows fetched.
Go up to
solidDB ADMIN COMMAND syntax