From 4daa6d2d0b3a66344709d2323276d21a0fa941df Mon Sep 17 00:00:00 2001 From: Tyler Hale Date: Mon, 6 Feb 2023 15:47:28 -0700 Subject: [PATCH] README Update --- README.md | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 28de7fa..f176f6c 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,50 @@ # Ansible-MariaDB-Cluster - +Ansible playbook that provisions a group of servers to run mariadb as a Galera Cluster. ## Requirements +If you are using HaProxy as a front end to the cluster, you will need to create a user for the health checks to work properly. The user does not need to be able to access any databases, it just needs to be able to authenticate against the server. + +```sql +CREATE USER 'haproxy_check'@'10.10.10.253' WITH MAX_QUERIES_PER_HOUR 1 MAX_UPDATES_PER_HOUR 0 MAX_STATEMENT_TIME 0.0000000001; +``` + ## Variables -| Variable | Required | Default | Choices | Description | -| -------- | -------- | ------- | ------- | ----------- | -| | | | | | +| Variable | Required | Default | Description | +| ---------------------------------- | -------- | ---------------- | -------------------------------------------------------------------------------------------------------------------- | +| mariadb_cluster_wsrep_cluster_name | yes | my_wsrep_cluster | The wsrep cluster name that should be used for the galera cluster | +| mariadb_cluster_access_ip | no | "" | If defined, the normal database port (3306) will only be accessible from the defined IP for use with a load balancer | ## Example +```yml +--- +# file: hosts + +mariadb_cluster: + hosts: + db01: + ansible_host: 10.10.10.11 + db02: + ansible_host: 10.10.10.12 + + vars: + mariadb_cluster_wsrep_cluster_name: "CustomCluster1" + mariadb_cluster_access_ip: "10.10.10.253" + ansible_user: ansible + +``` + +## Troubleshooting + +You can view the status of the cluster by running the following command. + +```sql +SHOW GLOBAL STATUS LIKE 'wsrep_%'; +``` + ## License See LICENSE file for full license information. - -## Screenshots