Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.0.12-galera
-
64-bit CentOS 6.5
galera-25.3.5-1.rhel6.x86_64 RPM
Description
I installed the galera 25.3.5 RPM from the http://yum.mariadb.org/10.0/centos6-amd64 repo and after configuring /etc/default/garb, I then ran "/etc/init.d/garb start" without any of the configured cluster nodes being up.
First issue is that line 122 reads:
nc -z $HOST $PORT >/dev/null && break
and yet a standard CentOS 6.5 server install doesn't include the "nc" command. I had to "yum install nc" to fix this, but the RPM should obviously have nc as a dependency.
Second problem is that the code in that loop (lines 118-123) will test each node and then set $ADDRESS = 0 (and hence $HOST =0 and $PORT = 0) if none of the ${GALERA_NODES} nodes are running. Unfortunately, this produces a port error message from CentOS 6.5's nc command because "nc -z 0 0" is, of course, not correct.
The fix for this is probably to only run the code if $ADDRESS != 0 e.g.:
for ADDRESS in ${GALERA_NODES} 0; do
if [ "$ADDRESS" != "0"]
then
HOST=$(echo $ADDRESS | cut -d \: -f 1 )
PORT=$(echo $ADDRESS | cut -d \: -f 2 )
PORT=${PORT:-$GALERA_PORT}
nc -z $HOST $PORT >/dev/null && break
fi
done