Bootstrap cluster when DNS entry is empty?

Hi, I’m using XtraDB 5.6 with consul for service discovery via DNS and the cluster is failing to bootstrap when there are no nodes yet available.

In my.cnf I have this set up on all nodes, and it works great when the cluster is bootstrapped on one node: wsrep_cluster_address=gcomm://db.service.consul

With the above, I can automatically add any number of new nodes to my cluster without intervention.
But when all three of my nodes are down I get this in my error.log and the cluster fails to bootstrap: “Failed to resolve tcp://db.service.consul:4567” and my cluster won’t bootstrap.

I guess this isn’t totally unexpected behavior, but if I were to leave my cluster_address as empty gcomm:// my cluster bootstraps as expected, and since DNS is returning 0 node addresses I would think the node would bootstrap itself.

Can anyone think of a workaround for this, or is this a bug?

Thanks for your time and input!

Hi,
This cluster has three nodes in total, right? So when all the three nodes are down, you need to start the first one using
service mysql bootstrap-pxc
Using empty value as ‘wsrep_cluster_address=gcomm://’ does the same, but using the startup command above let’s you to avoid changing my.cnf every time the cluster needs to be boostrapped.

When it comes to the resolve error, what is the Consul name to IP mapping result when all the nodes are down? Will it start resolving only after at least one node is up with MySQL service? If yes, then I cannot see anything wrong here, just proper bootstrapping is needed first.

Is there any settings in the cluster that specifies the ip-address? or will the galera cluster use the default port (which might be connected to overloaded switch)?

wqasderaa, yes you may specify IP address and port number for each part of Galera layer. See the docummentation:
http://www.percona.com/doc/percona-xtradb-cluster/5.6/wsrep-system-index.html#wsrep_node_address
http://www.percona.com/doc/percona-xtradb-cluster/5.6/wsrep-system-index.html#wsrep_node_incoming_address
http://www.percona.com/doc/percona-xtradb-cluster/5.6/wsrep-provider-index.html#gmcast.listen_addr