Replica count
Job details
Name: |
Replica count |
Platform: |
Mariadb |
Category: |
Cluster and Replication |
Description: |
This job collects the number of bytes received and sent from from other Galera Cluster nodes. |
Long description: |
|
Version: |
1.5 |
Default schedule: |
60s |
Requires engine install: |
No |
Compatibility tag: |
.[type=‘instance’ & databasetype=‘mariadb’]/instance[is_mariadb_branch=‘1′] |
Parameters
Name |
Default value |
Description |
min_slave_hosts |
0 |
The minimum number of slave hosts (replicas) registered with the source host. |
return_status |
1 |
Return status value (ALARM – 2, WARNING – 1, or OK – 0) when the number of slave hosts (replicas) registered with the source is less than min_slave_hosts parameter value. |
Job Summary
- Purpose: This dbWatch Control Center job is designed to monitor the number of replicas (slave hosts) currently registered with a source host in a MariaDB environment.
- Why: Monitoring the replica count is crucial for maintaining data redundancy and load distribution. Insufficient replicas can lead to a single point of failure and increased load on the primary database, potentially degrading performance and reliability. The job uses thresholds to trigger alarms or warnings if the number of replicas falls below a specified minimum.
- Manual checking: To manually check the replica count in MariaDB, you might execute a query to display slave status or count replica connections:
SHOW SLAVE STATUS;
Job Details
- Monitoring Scope: The job specifically targets instances identified as part of the MariaDB branch that are set up with replication.
- Replica Count Check: It retrieves the number of replicas and compares this against a predefined minimum acceptable count. If the actual count is less than the minimum, varying severity statuses (e.g., ALARM or WARNING) are triggered.
- Output Message: Provides detailed information in the output message regarding the number of replicas registered and whether this count is acceptable based on predefined settings.
Job Execution Environment
- Schedule: The job is scheduled to run every 60 seconds.
- Scripting Support: Utilizes both FDL and JavaScript engines for query and logic execution.
- Compatibility: The job is installable on dbWatch environments hosting MariaDB instances.
Job Configuration and Script Details
The job involves several technical components:
- Replica Count Query: Extracts the number of replicas using an FDL query.
- JavaScript Logic: It processes the result, comparing the actual replica count against the set minimum and updating the job status accordingly.
Report Template
- Title: “Replica count”
- Description: Focuses on the replication status, particularly on the count of replicas linked with the source database.
- Details Presentation: The report includes a table showing ‘Details’ based on the output from the job’s script, indicating the status between replication threads.
Data Columns
Column Name |
SQL Type |
Description |
Details |
Integer |
Displays the number of registered replicas and status messages |
Additional Output
- A textual section is added to the report under the title “Details,” offering insights into the status between the SQL applier (replication) thread and the I/O (receiver) thread, based on the latest monitoring results.
This monitoring job provides a crucial function in managing replication in MariaDB environments, ensuring consistent replication and flagging potential issues with replica count that might affect database performance and reliability.