Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6432

/etc/init.d/garb requires nc and produces an nc error if no cluster nodes are up

    Details

      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

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            rkl Richard Lloyd added a comment -

            I knew I'd miss some info and get something wrong too...

            It is, of course, /etc/sysconfig/garb that I edited on CentOS 6.5, not /etc/default/garb. My setup involved a 2-node cluster with a third node just running garbd, so an example line in the garb conf (IPs changed to protect the innocent ) would be:

            GALERA_NODES="192.168.0.1:4567 192.168.0.2:4567"

            with, say, the third node being 192.168.0.3. Also note that when the cluster is up and running, "/etc/init.d/garb start" runs successfully with no errors.

            Show
            rkl Richard Lloyd added a comment - I knew I'd miss some info and get something wrong too... It is, of course, /etc/sysconfig/garb that I edited on CentOS 6.5, not /etc/default/garb. My setup involved a 2-node cluster with a third node just running garbd, so an example line in the garb conf (IPs changed to protect the innocent ) would be: GALERA_NODES="192.168.0.1:4567 192.168.0.2:4567" with, say, the third node being 192.168.0.3. Also note that when the cluster is up and running, "/etc/init.d/garb start" runs successfully with no errors.
            Hide
            nirbhay_c Nirbhay Choubey added a comment -

            Thank you for reporting the bug and suggestions.
            I have opened a bug with galera : https://bugs.launchpad.net/galera/+bug/1341028

            Show
            nirbhay_c Nirbhay Choubey added a comment - Thank you for reporting the bug and suggestions. I have opened a bug with galera : https://bugs.launchpad.net/galera/+bug/1341028
            Hide
            nirbhay_c Nirbhay Choubey added a comment -

            Fixed in galera-25.3.9.

            Show
            nirbhay_c Nirbhay Choubey added a comment - Fixed in galera-25.3.9.

              People

              • Assignee:
                nirbhay_c Nirbhay Choubey
                Reporter:
                rkl Richard Lloyd
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 minutes
                  5m
                  Remaining:
                  Remaining Estimate - 5 minutes
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified