cassandra_status -- Validates the status of the cluster as seen from the node.

Synopsis

Validates the status of the cluster as seen from the C* node.

Ensure that all nodes are in a UP/NORMAL state or tolerate a few down nodes.

Optionally poll multiple times to allow the cluster state to stablise.

Cluster status is obtained thtough the usage of the nodetool status command.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

down (optional, int, 0)
The maximum number of nodes that can be tolerated as down.
poll (optional, int, 1)
The maximum number of times to call nodetool status to query cluster status.
interval (optional, int, 30)
The number of seconds to wait between poll executions.
host (optional, str, 127.0.0.1)
The hostname.
port (optional, int, 7199)
The Cassandra TCP port.
password (optional, str, None)
The password to authenticate with.
password_file (optional, str, None)
Path to a file containing the password.
username (optional, str, None)
The username to authenticate with.
nodetool_path (optional, str, None)
The path to nodetool.
nodetool_flags (optional, str, -Dcom.sun.jndi.rmiURLParsing=legacy)
Flags to pass to nodetool.
debug (optional, bool, False)
Enable additional debug output.

Examples

- name: Ensure all Cassandra nodes are in the UN (Up/Normal) state.
  community.cassandra.cassandra_status:

- name: Ensure all Cassandra nodes are in the UN (Up/Normal) state polling max 3 times, 60 seconds interval
  community.cassandra.cassandra_status:
    poll: 3
    interval: 60

- name: Ensure down nodes are no more than 1
  community.cassandra.cassandra_status:
    down: 1

Return Values

msg (on success, bool, )
A message indicating what has happened.
rc (always, int, )
Return code of the last executed command.

Status

Authors

  • Rhys Campbell (@rhysmeister)