Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaweedbrainCY authored Jul 6, 2024
1 parent 6054259 commit d269400
Showing 1 changed file with 66 additions and 2 deletions.
68 changes: 66 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# galera Cluster Healthcheck
# Galera Cluster Healthcheck
This is a very basic docker container that helthcheck the nodes of a Mariadb Galera Cluster.

**Contributors :**

![GitHub Contributors Image](https://contrib.rocks/image?repo=seaweedbraincy/galera_cluster_healthcheck)
## Features
### Monitoring a specific node
Use the healthcheck to monitor a specific and retrieve metrics from Galera. To determine the health of your cluster, the script will monitor :
Expand All @@ -14,4 +17,65 @@ Use the healthcheck to monitor a specific and retrieve metrics from Galera. To d
### Discord notification
For now, the only mean of notification implemented is through discord webhook notification.

Thus the script is made to be modulable with many other notification medium.
**When the cluster is healthy :**

<img width="40%" src=https://github.com/SeaweedbrainCY/galera_cluster_healthcheck/assets/42048771/c66ee07b-427d-4a6e-ab2e-3dd0741eceee)/>

**When an error is detected :**

<img width="40%" src=https://github.com/SeaweedbrainCY/galera_cluster_healthcheck/assets/42048771/f292048f-a1bb-4c66-8fd5-6e3f806460fb)/>


Thus the script is made to be modulable with many other notification medium.

## Installation
### Docker compose
You can use the ![docker-compose.yml](https://raw.githubusercontent.com/SeaweedbrainCY/galera_cluster_healthcheck/main/docker-compose.yml) file from the repo, or directly this config :
```yml
version: '3.7'

services:
galera_health_check:
container_name: galera_health_check
image: ghcr.io/seaweedbraincy/galera_cluster_healthcheck:b0.3
user: 1000:1000
security_opt:
- no-new-privileges:true
read_only: true
environment:
DB_USER: <REPLACE_ME> # required
DB_PASSWORD: <REPLACE_ME> # required
DB_HOST: <REPLACE_ME> # required
DB_PORT: 3306 # optional. Default is 3306
CHECK_INTERVAL: 60 # optional. Default is 60. Healthcheck interval in seconds
ALERT_THROTTLE: 10800 # optional. Default is 10800s (3h). Amount of time in senconds between 2 consecutive alerts
NODE_NAME: <REPLACE_ME> # required. Used to identify the node in the alert message
CLUSTER_MIN_SIZE: <REPLACE_ME> # required. Minimum number of nodes in the cluster, used to determine if the cluster is in a degraded state
WEBHOOK_URL: <REPLACE_ME> # required. Discord webhook URL for notifications
volumes:
- ./docker_logs:/app/logs
restart: always
```
### Configuration
You can use several env variable to configure the script :
| Variable | Is required | Defintion|
| -------- | ------- | ------- |
| DB_USER | **REQUIRED** | Mariadb user used to connect to the database. The user should only be able to read mariadb GLOBAL STATUS variables |
| DB_PASSWORD | **REQUIRED** |Password of the user used to connect to the database.|
| DB_HOST | **REQUIRED** | Mariadb host|
| DB_PORT | *optional* |Port used by mariadb. Default value : 3306|
| ALERT_THROTTLE | *optional* | Amount of time in senconds between 2 consecutive alerts. Default value : 10800s (3h).|
| CHECK_INTERVAL | *optional* | Healthcheck interval in seconds. Default value: 60|
| NODE_NAME | **REQUIRED** |Used to identify the node in the alert message. |
| CLUSTER_MIN_SIZE | **REQUIRED** |Minimum number of nodes in the cluster. This is used to determine if the cluster is in a degraded state|
| WEBHOOK_URL | **REQUIRED** |Discord webhook URL used to send notifications|
## Contribution
All contributions are welcome ! Feel free to open a merge request
## Licence
The code is under MIT Licence

0 comments on commit d269400

Please sign in to comment.