Notification Script

If wsrep_notify_cmd is set, the server will try to invoke this command every time cluster membership or local node status changes. This can be used to (re)configure load balancers, raise alarm and so on.

Notification Command Arguments

The command will be passed one or more of the following options:

  • --status <status str>

    status of this node.

  • --uuid <state UUID>

    — cluster state UUID.

  • --primary <yes/no>

    — whether current cluster component is primary or not.

  • --members <comma-separated list of the component member UUIDs>
  • --index <n>

    — index of this node in the member list (base 0).

Node Status String

  1. “Undefined” — the node just started and is not connected to any primary component
  2. “Joiner” — the node is connected to primary component and now is receiving state snapshot.
  3. “Donor” — the node is connected to primary component and now is sending state snapshot.
  4. “Joined” — the node has complete state and now is catching up with the cluster.
  5. “Synced” — the node has synchronized with the cluster.
  6. “Error(<error code if available>)”

Only the node in “Synced” state should accept connections. See galera_node_fsm for additional information on node states.

Member List Element

Each member list element has a format:

<node UUID>/<node name>/<incoming address>

where

  • <node UUID> — is an unique node ID automatically assigned to it by wsrep provider.
  • <node name> — node name as set in wsrep_node_name.
  • <incoming address> — address for client connections as set in wsrep_node_incoming_address

Example

Here's the example script that updates two tables on the local node with changes happening in the cluster.

Login