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

Support bootstraping a Galera cluster with mysqld_multi

Details

    Description

      Starting a Galera cluster with mysqld_multi currently requires to manually add (and later remove) --wsrep-new-cluster in the config block of the mysqld instance that is supposed to become the first cluster node.

      I suggest to add a --new-cluster option to mysqld_multi that will add --wsrep-new-cluster to the mysqld command line of each server process started by mysqld_multi --new-cluster start ...

      Attachments

        Issue Links

          Activity

            hholzgra Hartmut Holzgraefe added a comment - - edited

            Suggested patch:

            diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
            index e3f8e50..19c94b1 100644
            --- a/scripts/mysqld_multi.sh
            +++ b/scripts/mysqld_multi.sh
            @@ -47,6 +47,7 @@ $opt_help          = 0;
             $opt_log           = undef();
             $opt_mysqladmin    = "@bindir@/mysqladmin";
             $opt_mysqld        = "@libexecdir@/mysqld";
            +$opt_new_cluster   = 0;
             $opt_no_log        = 0;
             $opt_password      = undef();
             $opt_tcp_ip        = 0;
            @@ -125,7 +126,7 @@ sub main
             
               # We've already handled --no-defaults, --defaults-file, etc.
               if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s",
            -                  "user=s", "password=s", "log=s", "no-log",
            +                  "user=s", "password=s", "log=s", "new-cluster", "no-log",
                               "tcp-ip",  "silent", "verbose"))
               {
                 $flag_exit= 1;
            @@ -378,6 +379,9 @@ sub start_mysqlds()
                   $info_sent= 1;
                 }
                 $com.= $tmp;
            +    if ($opt_new_cluster) {
            +      $com.= " --wsrep-new-cluster";
            +    }
                 $com.= " >> $opt_log 2>&1" if (!$opt_no_log);
                 $com.= " &";
                 if (!$mysqld_found)
            

            hholzgra Hartmut Holzgraefe added a comment - - edited Suggested patch: diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index e3f8e50..19c94b1 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -47,6 +47,7 @@ $opt_help = 0; $opt_log = undef(); $opt_mysqladmin = "@bindir@/mysqladmin"; $opt_mysqld = "@libexecdir@/mysqld"; +$opt_new_cluster = 0; $opt_no_log = 0; $opt_password = undef(); $opt_tcp_ip = 0; @@ -125,7 +126,7 @@ sub main # We've already handled --no-defaults, --defaults-file, etc. if (!GetOptions("help", "example", "version", "mysqld=s", "mysqladmin=s", - "user=s", "password=s", "log=s", "no-log", + "user=s", "password=s", "log=s", "new-cluster", "no-log", "tcp-ip", "silent", "verbose")) { $flag_exit= 1; @@ -378,6 +379,9 @@ sub start_mysqlds() $info_sent= 1; } $com.= $tmp; + if ($opt_new_cluster) { + $com.= " --wsrep-new-cluster"; + } $com.= " >> $opt_log 2>&1" if (!$opt_no_log); $com.= " &"; if (!$mysqld_found)
            nirbhay_c Nirbhay Choubey (Inactive) added a comment - http://lists.askmonty.org/pipermail/commits/2016-June/009471.html

            ok to push

            serg Sergei Golubchik added a comment - ok to push

            People

              nirbhay_c Nirbhay Choubey (Inactive)
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.