codership / galera

Synchronous multi-master replication library
GNU General Public License v2.0
448 stars 176 forks source link

gcomm parameter in /etc/init.d/garb #252

Open MartinOehler opened 9 years ago

MartinOehler commented 9 years ago

Galera Version: galera-3-25.3.10-2.el6.x86_64 OS: CentOS 6.6

With multiple galera hosts in /etc/sysconfig/garb

 # A space-separated list of node addresses (address[:port]) in the cluster
GALERA_NODES="192.168.122.2:4567 192.168.122.3:4567"

garb is only connecting to the first reachable cluster node:

/etc/init.d/garb:
[...]
for ADDRESS in ${GALERA_NODES} 0; do
  # break at successful port connection
  [...]
done

# ADDRESS now holds the IP of the first successful connection or 0

if [ ${ADDRESS} == "0" ]; then
  log_failure "None of the nodes in $GALERA_NODES is accessible"
  return 1
fi

OPTIONS="-d -a gcomm://$ADDRESS"

If this example, garbd starts with gcomm://192.168.122.2:4567.

But when defining multiple cluster hosts we want a resulting gcomm statement that lists all of them (e.g. HOSTS="${GALERA_NODES/\ /,}"; OPTIONS="-d -a gcomm://$HOSTS") which would result in gcomm://192.168.122.2:4567,192.168.122.3:4567

ayurchen commented 9 years ago

yeah, looks like a leftover from the days when gcomm accepted only a single address