1

While evaluating the galera cluster, on the documentation it mentions that all cluster members should be listed on the "wsrep_cluster_address" setting...

This doesn't seem very scalable to me as adding a new node would mean having to reconfigure all existing nodes.

Is it so? or is there any way of not having to specify all nodes on that variable?

2 Answers2

1

EDIT:

My original answer below is still correct, but the is an easier way to handle this: multicast. I didn't mention this before because I thought galera could only use multicast for replication, which is probably something else you probably want to configure to save bandwidth with a large number of nodes. Basically, you can use a multicast address for the cluster connection in wsrep_cluster_address. Using multicast will allow you to configure a single address on every node. I'm using multicast for replicating data in my galera cluster, but unicast for the cluster connection. The page I link to doesn't say anything explicitly about it, but you might need to configure a different multicast address for the galera data replication channel (gmcast.mcast_addr) and the cluster information channel (wsrep_cluster_address). More information on using multicast with galera is available in a Percona blog post.

Original:

It is not required to have every node in the cluster defined in wsrep_cluster_address. When a node starts up, it tries to connect to the provided addresses to connect to an existing cluster and then connect to all of the other current nodes in the cluster. It only really needs to connect to a single node in the cluster to join since it connects to other nodes based on the current state of the cluster. Because of that, if you specify a few nodes that should always be in the cluster, you should be fine even if there are many other nodes that are not specified.

G-Nugget
  • 688
  • 3
  • 13
0

Actually specifying all members in wsrep_cluster_address is highly recommended but not mandatory - here is an extraction from official documentation:

"The new node only needs to connect to one of the existing cluster nodes. Once it connects to one of the existing cluster nodes, it will be able to see all of the nodes in the cluster. However, it is generally better to list all nodes of the cluster in wsrep_cluster_address, so that any node can join a cluster by connecting to any of the other cluster nodes, even if one or more of the cluster nodes are down"

See documentation

I saw such implementation in kubernetes Galera multi-master setups - the wsrep_cluster_address is set to dns name of k8s service instead of specifying all dns names of the pods (it is possible that IP address of the pod is changed however Galera will still try to connect to old IP)

Tom V
  • 15,752
  • 7
  • 66
  • 87