[MDEV-4253] service mysql start --wsrep-cluster-address=gcomm:// does not work Created: 2013-03-07  Updated: 2014-07-15  Resolved: 2014-07-15

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.29-galera
Fix Version/s: 5.5.39-galera

Type: Bug Priority: Major
Reporter: Tomas Gustavsson Assignee: Seppo Jaakola
Resolution: Fixed Votes: 0
Labels: galera
Environment:

Ubuntu 12.04, MariaDB-Galera 5.5.29


Issue Links:
Duplicate
is duplicated by MDEV-4509 mysql init script should accept argum... Closed
Relates
relates to MDEV-4138 Galera: mysqld_safe doesn't pass on w... Closed
relates to MDEV-4508 Ubuntu (possible debian) /etc/init.d/... Closed
relates to MDEV-4509 mysql init script should accept argum... Closed
relates to MDEV-4508 Ubuntu (possible debian) /etc/init.d/... Closed

 Description   

In galera docs:
http://www.codership.com/wiki/doku.php?id=mysql_galera_configuration

It says in section "3. wsrep Settings" that you can start the first cluster node with:
service mysql start --wsrep-cluster-address=gcomm://

But it does not work. The wsrep-cluster-address is still taken from my.cnf.

Giving it on command line should be good since you do not have to edit my.cnf, and then risk not editing it back to connect to a running cluster (since you don't want to start a second node as master).



 Comments   
Comment by Tomas Gustavsson [ 2013-03-07 ]

This is probably caused by the same thing as MDEV-4138.

Comment by Elena Stepanova [ 2013-03-07 ]

mysqld_safe from 5.5.29 accepts and passes through wsrep_cluster_address all right, so apparently the problem is different from MDEV-4138, after all (MDEV-4138 is still reproducible on 5.5.29).

Comment by Tomas Gustavsson [ 2013-03-08 ]

Looking at /usr/bin/mysqld_safe and /etc/init.d/mysql it looks correct. mysqld_safe reads wsrep_cluster_address,but /etc/init.d/mysql does not pass any arguments to mysqld_safe.

Comment by Elena Stepanova [ 2013-03-08 ]

That's right, whatever changes were made to codership's mysql service script, they are not in MariaDB version as of 5.5.29, it just starts mysqld_safe without any parameters.

However, I'm looking at the Codership's version from https://launchpad.net/codership-mysql/5.5/5.5.28-23.7/+download/mysql-server-wsrep-5.5.28-23.7-amd64.deb , and it doesn't look very promising either. Here is the whole fragment which deals with wsrep:

  1. Check for additional wsrep options
    WSREP_OPTS=${WSREP_OPTS:-""}
    WSREP_PROVIDER=${WSREP_PROVIDER:-""}
    WSREP_CLUSTER_ADDRESS=${WSREP_CLUSTER_ADDRESS:-""}
    test -n "$WSREP_PROVIDER" && \
    WSREP_OPTS="$WSREP_OPTS --wsrep_provider=$WSREP_PROVIDER"
    test -n "$WSREP_CLUSTER_ADDRESS" && \
    WSREP_OPTS="$WSREP_OPTS --wsrep_cluster_address=$WSREP_CLUSTER_ADDRESS"
  1. Start MySQL!.
    echo "/usr/bin/mysqld_safe $WSREP_OPTS"
    /usr/bin/mysqld_safe $WSREP_OPTS > /dev/null 2>&1 &

I'm not quite sure I understand the idea, it looks like the values have to be set in the environment to get it work?
At least the command suggested in http://www.codership.com/wiki/doku.php?id=mysql_galera_configuration#wsrep_cluster_address ,
"service mysql start --wsrep-cluster-address=gcomm://", does not work there either, the cluster address is ignored. Possibly it was implemented later, but I haven't found a release package to check.

So, to make it actually work in the next version of MariaDB Galera, we need to have proper parameter processing added to the service script, not just copy the logic above.

Comment by Elena Stepanova [ 2013-05-10 ]

See also MDEV-4508

Comment by Tomas Gustavsson [ 2013-05-14 ]

Verified that the patch given in MDEV-4509 works good for me.

Comment by Elena Stepanova [ 2013-06-11 ]

Hi Seppo,

Please close if it's already fixed. Otherwise, I'm raising the priority since it should be fairly easy to fix, and the current behavior doesn't match Galera documentation.
Please reassign if it doesn't belong to you.
See also MDEV-4509.

Comment by Daniel Black [ 2014-03-04 ]

Based of the CentOS scripts using --wsrep-new-cluster I've updated https://mariadb.com/kb/en/getting-started-with-mariadb-galera-cluster/

To make a bootstrap option the same as the CentOS scripts. That way service mysql bootstrap will instigate a primary node.

--- mysql       2014-03-04 01:10:47.000000000 +0000
+++ mysql-new   2014-03-04 01:17:18.000000000 +0000
@@ -178,7 +178,10 @@
          exit 3
        fi
        ;;
-
+  'bootstrap')
+       log_daemon_msg "Bootstrap MariaDB database server" "mysqld"
+        $0 start "${@:2}" --wsrep-new-cluster
+        ;;
   *)
        echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
        exit 1

Comment by Nirbhay Choubey (Inactive) [ 2014-07-15 ]

http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3799

Comment by Nirbhay Choubey (Inactive) [ 2014-07-15 ]

This has been addressed already by MDEV-4509.

Generated at Thu Feb 08 06:54:59 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.