|
1 | 1 | # galera_maxscale
|
2 | 2 |
|
3 |
| -#### Table of Contents |
| 3 | +#### Module Deprecation Notice |
4 | 4 |
|
5 |
| -1. [Description](#description) |
6 |
| -1. [Setup - The basics of getting started with galera_maxscale](#setup) |
7 |
| - * [Beginning with galera_maxscale](#beginning-with-galera_maxscale) |
8 |
| -1. [Usage - Configuration options and additional functionality](#usage) |
9 |
| -1. [Reference - An under-the-hood peek at what the module is doing and how](#reference) |
10 |
| -1. [Limitations - OS compatibility, etc.](#limitations) |
11 |
| -1. [Development - Guide for contributing to the module](#development) |
| 5 | +Please consider using the new module [galera_proxysql](https://forge.puppet.com/maxadamo/galera_proxysql). |
12 | 6 |
|
13 |
| -## Description |
| 7 | +The new module makes use of Percona instead of MariaDB. |
14 | 8 |
|
15 |
| -This module sets up and bootstrap Galera cluster and optionally MaxScale Proxy. |
16 |
| -The status of the cluster is checked at run time through the fact `galera_status` and puppet will attempt to re-join the node in case of disconnection. |
17 |
| -If puppet fails to recover a node you can use the script `galera_wizard.py` provided with this module. |
18 |
| -MaxScale Proxy will be set up on 2 nodes (no more, no less) with Keepalived. |
| 9 | +I came to this decision after having observed the followings: |
19 | 10 |
|
20 |
| -- if you want only the Galera cluster you need _at least_ 3 servers and 3 ipv4 (and optionally 3 ipv6) |
21 |
| -- if you want the full stack you need _at least_ 5 servers and 6 IPv4 (and optionally 6 IPv6) |
22 |
| - |
23 |
| -Initial State Snapshot Transfer is supported only through Percona XtraBackup (on average DBs I see no reason to use `mysqldump` and `rsync` since the donor would be unavailable during the transfer: see [Galera Documentation](http://galeracluster.com/documentation-webpages/sst.html)). |
24 |
| -The backup provided with this modules is indeed poor, but it can be considered as an example if you want to start using Percona XtraBackup. |
25 |
| - |
26 |
| -**When bootstrapping, avoid running puppet on all the nodes at same time.** You need to bootstrap one node first. |
27 |
| - |
28 |
| -**stay tuned:** since the module is at an early stage, for the time being it will receive frequent updates. |
29 |
| - |
30 |
| - |
31 |
| -Read at (actual) **limitations** in the paragraph below. |
32 |
| - |
33 |
| - |
34 |
| -## Setup |
35 |
| - |
36 |
| -### Beginning with galera_maxscale |
37 |
| - |
38 |
| -To setup Galera: |
39 |
| - |
40 |
| -```puppet |
41 |
| -class { '::galera_maxscale': |
42 |
| - root_password => $root_password, |
43 |
| - sst_password => $sst_password, |
44 |
| - monitor_password => $monitor_password, |
45 |
| - maxscale_hosts => $maxscale_hosts, |
46 |
| - maxscale_vip => $maxscale_hosts, |
47 |
| - galera_hosts => $galera_hosts, |
48 |
| - trusted_networks => $trusted_networks, |
49 |
| - manage_lvm => true, |
50 |
| - vg_name => 'rootvg', |
51 |
| - lv_size => $lv_size; |
52 |
| -} |
53 |
| -``` |
54 |
| - |
55 |
| -To setup MaxScale: |
56 |
| -```puppet |
57 |
| -class { '::galera_maxscale::maxscale::maxscale': |
58 |
| - trusted_networks => $trusted_networks, |
59 |
| - maxscale_hosts => $maxscale_hosts, |
60 |
| - maxscale_vip => $maxscale_vip, |
61 |
| - galera_hosts => $galera_hosts; |
62 |
| -} |
63 |
| -``` |
64 |
| - |
65 |
| -Once you have run puppet on every node, you can manage or check the cluster using the script: |
66 |
| -``` |
67 |
| -[root@test-galera01 ~]# galera_wizard.py -h |
68 |
| -usage: galera_wizard.py [-h] [-cg] [-dr] [-je] [-be] [-jn] [-bn] |
69 |
| -
|
70 |
| -Use this script to bootstrap, join nodes within a Galera Cluster |
71 |
| ----------------------------------------------------------------- |
72 |
| - Avoid joining more than one node at once! |
73 |
| -
|
74 |
| -optional arguments: |
75 |
| - -h, --help show this help message and exit |
76 |
| - -cg, --check-galera check if all nodes are healthy |
77 |
| - -dr, --dry-run show SQL statements to run on this cluster |
78 |
| - -je, --join-existing join existing Cluster |
79 |
| - -be, --bootstrap-existing bootstrap existing Cluster |
80 |
| - -jn, --join-new join existing Cluster |
81 |
| - -bn, --bootstrap-new bootstrap new Cluster |
82 |
| - -f, --force force bootstrap new or join new Cluster |
83 |
| -
|
84 |
| -Author: Massimiliano Adamo <maxadamo@gmail.com> |
85 |
| -``` |
86 |
| - |
87 |
| -## Usage |
88 |
| - |
89 |
| -The module will fail on Galera with an even number of nodes and with a number of nodes lower than 3. |
90 |
| - |
91 |
| -To setup a Galera Cluster (and optionally a MaxScale cluster with Keepalived) we need a hash. If you use hiera it will be like this: |
92 |
| - |
93 |
| -```yaml |
94 |
| -galera_hosts: |
95 |
| - test-galera01.example.net: |
96 |
| - ipv4: '192.168.0.83' |
97 |
| - ipv6: '2001:123:4::6b' |
98 |
| - test-galera02.example.net: |
99 |
| - ipv4: '192.168.0.84' |
100 |
| - ipv6: '2001:123:4::6c' |
101 |
| - test-galera03.example.net: |
102 |
| - ipv4: '192.168.0.85' |
103 |
| - ipv6: '2001:123:4::6d' |
104 |
| -maxscale_hosts: |
105 |
| - test-maxscale01.example.net: |
106 |
| - ipv4: '192.168.0.86' |
107 |
| - ipv6: '2001:123:4::6e' |
108 |
| - test-maxscale02.example.net: |
109 |
| - ipv4: '192.168.0.87' |
110 |
| - ipv6: '2001:123:4::6f' |
111 |
| -maxscale_vip: |
112 |
| - test-maxscale.example.net: |
113 |
| - ipv4: '192.168.0.88' |
114 |
| - ipv4_subnet: '22' |
115 |
| - ipv6: '2001:123:4::70' |
116 |
| -``` |
117 |
| -
|
118 |
| -If you do not use ipv6, just skip the `ipv6` keys as following: |
119 |
| -```yaml |
120 |
| -galera_hosts: |
121 |
| - test-galera01.example.net: |
122 |
| - ipv4: '192.168.0.83' |
123 |
| - test-galera02.example.net: |
124 |
| - ipv4: '192.168.0.84' |
125 |
| - test-galera03.example.net: |
126 |
| -... and so on .. |
127 |
| -``` |
128 |
| - |
129 |
| -you need an array of trusted networks/hosts (a list of ipv4/ipv6 networks/hosts allowed to connect to MySQL socket): |
130 |
| -```yaml |
131 |
| -trusted_networks: |
132 |
| - - 192.168.0.1/24 |
133 |
| - - 2001:123:4::70/64 |
134 |
| - - 192.168.1.44 |
135 |
| -... and so on ... |
136 |
| -``` |
137 |
| - |
138 |
| -## Reference |
139 |
| - |
140 |
| - |
141 |
| - |
142 |
| -## Limitations |
143 |
| - |
144 |
| -- minor version supports only latest and installed (in other words, only major versions are supported) |
145 |
| -- init script management can be improved |
146 |
| -- not yet tested on ipv4 only (it should work) |
147 |
| - |
148 |
| -## Development |
149 |
| - |
150 |
| -Feel free to make pull requests and/or open issues on [my GitHub Repository](https://github.com/maxadamo/galera_maxscale) |
151 |
| - |
152 |
| -## Release Notes/Contributors/Etc. **Optional** |
| 11 | +1. percona repository is still needed to use percona tools |
| 12 | +1. the preferred method for SST is Percona-extrabackup |
| 13 | +1. maxscale started throwing coredumps |
| 14 | +1. a bug in the extrabackup-v2 script appeared all of a sudden and I had to roll-back to extrabackup |
| 15 | +1. With Percona only 1 repository is needed. With MariaDB 3 repositories were needed (1 for Percona, 1 for MariaDB, 1 for MaxScale). |
0 commit comments