A common question we get is: can I add a node to my Galera Cluster without restarting the entire cluster? The simple answer is YES.
A lot worry about the fact that you do list servers that are part of the cluster within your my.cnf, and this file is not reloadable in a dynamic fashion. Fret not, though, because as long as your my.cnf has one active cluster member (the DONOR), you can have it be the JOINER.
If for example, you have 3 nodes: galera1: 220.127.116.11 galera2: 18.104.22.168 galera3: 22.214.171.124
The my.cnf line for wsrep_address should read as follows:
It is then trivial for you to have your fourth server (say, galera4: 126.96.36.199), have a my.cnf that reads as follows:
Now, 188.8.131.52 will find either one of the first 3 nodes as a DONOR. To be clear, you can even just point it to the IP address of galera1, galera2, or galera3, and it will be no issue. It is just better to be complete, from a configuration management standpoint.
Best practices do state that you should probably have the line updated across all your nodes, i.e. galera1/galera2/galera3, but you do not need to make any server restarts. If the nodes do require restarts during a normal maintenance cycle, it will read the now edited my.cnf with no issue. It goes without saying that if you’re using the rsync method for SST, make sure that SELinux is configured to handle this on both the DONOR and JOINER (or if you want to, you can disable SELinux, too; this can be done dynamically, without a server restart in Linux; check via sestatus and you can execute: setenforce 0.)
The easiest way to do this, is of course, via using Galera Manager. You don’t have to configure anything, touch any text files, and it is all point and click.
A 3-node Galera Cluster, fully deployed by Galera Manager
Click the corner drop down, and add a node
Straightforward to add your fourth node
All four nodes are now present, automatically deployed and managed for you
Incidentally, if you poke around your Galera Manager generated configurations, don’t be surprised if you just see 2 nodes, instead of the full 3, for a minimum setup, e.g.:
You’ll also notice that you can find it at /etc/mysql/wsrep/conf.d/ (on Red Hat based distributions; the location differs on Ubuntu).
As a closing note, we would like to remind you that having a four node Galera Cluster isn’t ideal; for reference, do read the documentation on weighted quorums.