Galera Cluster node state
Job details
Name: | Galera Cluster node state |
Platform: | Mariadb |
Category: | Cluster and Replication |
Description: | Checks then cluster node state value. When a node is part of the Primary Component, the following states can be returned; Joining, Waiting on SST, Joined, Synced or Donor. |
Long description: | Checks then cluster node state value. When a node is part of the Primary Component, the following states can be returned; Joining, Waiting on SST, Joined, Synced or Donor. |
Version: | 1.1 |
Default schedule: | 4,14,24,34,44,54 * * * |
Requires engine install: | Yes |
Compatibility tag: | .[type=‘instance’ & is_mariadb_branch=‘1′]/.[hasengine=‘YES’ & use_global_variables_information_schema = ‘1′ & wsrep_cluster != ‘0′] |
Parameters
Name | Default value | Description |
---|---|---|
permitted state | Synced | The Galera Cluster permitted state value. The following states can be returned; Joining, Waiting on SST, Joined, Synced or Donor. |
return status | 2 | Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the Galera Cluster node state is different from “permitted state” parameter value. |
enable warnings and alarms | YES | If set to “NO” the alert will only collect statistics without returning status warning or alarm. Value “YES“ will activate the alert. |
history threshold | 7 | The maximum number of day to kept statistics for in the historic tables. |
Job Summary
- Purpose: The purpose of this job is to monitor and check the Galera Cluster node state in a MariaDB environment. It assesses current node states such as Joining, Waiting on SST, Joined, Synced, or Donor, which are all critical for maintaining the stability and performance of the cluster.
- Why: This job is important because it ensures that each node in a Galera Cluster is in its correct state or alerts when a node’s state diverges from the expected “permitted state”. It helps in maintaining the integrity and efficiency of database operations, essential for systems requiring high availability and consistency.
- Manual checking: You can check the cluster node state manually by querying the global_status in the information_schema in the MariaDB database with this SQL command:
SELECT VARIABLE_VALUE FROM information_schema.global_status WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
Implementation Details
This job involves various SQL operations and procedures:
- Creating history tables to store state changes over time for analysis and tracking.
- Checking the current state against permitted states configured in the job parameters.
- Updating records and handling conditions where the state does not match the expected state, including error handling and exception management.
- Maintaining a history log of the state changes which is then used for generating reports and alerts if configured.
Dependencies and Cleanup
The job has several dependencies:
- dbw_galera_cluster_node_state – Main procedure
- dbw_galera_cluster_node_state_histr – Dependency table for historical data
- dbw_galera_cluster_node_state_last – Table capturing the last known state
In case of job failure, cleanup activities include:
DROP TABLE dbw_galera_cluster_node_state_histr;
DROP TABLE dbw_galera_cluster_node_state_last;
DROP PROCEDURE dbw_galera_cluster_node_state;
Reporting
The job provides a report template inside dbWatch which includes:
- Displaying the node state.
- History of state changes with minimum and maximum dates showing the ranging duration of each state.
Table Format:
Galera Cluster node state | Oldest history date | Last history date |
---|
Compatibility and Installation
This job is specifically tailored for instances where:
- The database type is MariaDB and it is configured with a Galera Cluster.
- Necessary global variables and conditions for Galera operations are met according to the dbWatch system’s requirements.
The installation is marked for express and force install, ensuring that the job gets installed and replaces any existing versions if applicable.
Categories and Metadata
The job falls under the following category:
- Cluster and Replication, reflecting its role in monitoring and managing database clusters and replication states.
Overall, this dbWatch job plays a vital role in the proactive monitoring and management of Galera Clusters in MariaDB, dedicating resources to ensure cluster health and performance through continuous state validation and historical data tracking.