Documentation ¶
Index ¶
Constants ¶
const ( NodeOperationModeStarting = "STARTING" NodeOperationModeNormal = "NORMAL" NodeOperationModeJoining = "JOINING" NodeOperationModeLeaving = "LEAVING" NodeOperationModeDecommissioned = "DECOMMISSIONED" NodeOperationModeMoving = "MOVING" NodeOperationModeDraining = "DRAINING" NodeOperationModeDrained = "DRAINED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeOperationMode ¶
type NodeOperationMode string
type NodeState ¶
type NodeState string
NodeState represents the cluster membership state of a C* node.
type NodeStatus ¶
type NodeStatus string
NodeState represents the reachability of a C* node from the perspective of the node answering the query.
const ( NodeStatusUnknown NodeStatus = "Unknown" NodeStatusUp NodeStatus = "Up" NodeStatusDown NodeStatus = "Down" )
type Nodetool ¶
func NewFromURL ¶
func (*Nodetool) Decommission ¶
func (*Nodetool) OperationMode ¶
func (t *Nodetool) OperationMode() (NodeOperationMode, error)
OperationMode gets the Operation Mode for the specific Cassandra instance. This command is available even after the node has decommissioned.
func (*Nodetool) Status ¶
Status generates a summary of the status of every C* node in the cluster. From the perspective of the local node.
It is intended to produce identical information to the `nodetool status` utility. But it only a reports a subset of the `nodetool status` information, for now. Enough to allow Navigator to determine whether a node is Up and Normal (healthy). This function returns structured information about the Cassandra cluster health, which avoids having to parse the unstructured, human readable output of `nodetool status`. Here is an example of the parsing that we are seeking to avoid: https://github.com/kubernetes/examples/blob/b86c9d50be45eaf5ce74dee7159ce38b0e149d38/cassandra/image/files/ready-probe.sh And here is the source code for the `nodetool status`: https://github.com/apache/cassandra/blob/cassandra-3.11.2/src/java/org/apache/cassandra/tools/nodetool/Status.java
Algorithm ¶
For every C* node that has reported its `host_id` (i.e. present in HostIdMap): * Determine the status of the node (one of live, unreachable, unknown) * Determine the state of the node (one of leaving, joining, moving, normal)
We perform additional assertions to check that a node is only present in one status and one state. If these assertions fail, we return an error so as to avoid reporting false positive status. Note: `nodetool status` does not perform these assertions.