summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysqld_multi.sh14
-rw-r--r--scripts/wsrep_sst_common.sh58
-rw-r--r--scripts/wsrep_sst_mariabackup.sh38
-rw-r--r--scripts/wsrep_sst_rsync.sh10
4 files changed, 113 insertions, 7 deletions
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 64fa76f0e97..0bd50c1974f 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -308,7 +308,9 @@ sub report_mysqlds
sub start_mysqlds()
{
- my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $info_sent);
+ my (@groups, $com, $tmp, $i, @options, $j, $mysqld_found, $suffix_found, $info_sent);
+
+ $suffix_found= 0;
if (!$opt_no_log)
{
@@ -347,6 +349,10 @@ sub start_mysqlds()
$options[$j]= quote_shell_word($options[$j]);
$tmp.= " $options[$j]";
}
+ elseif ("--defaults-group-suffix=" eq substr($options[$j], 0, 24))
+ {
+ $suffix_found= 1;
+ }
else
{
$options[$j]= quote_shell_word($options[$j]);
@@ -364,6 +370,12 @@ sub start_mysqlds()
}
$com.= $tmp;
+ if (!$suffix_found)
+ {
+ $com.= " --defaults-group-suffix=";
+ $com.= $groups[$i];
+ }
+
if ($opt_wsrep_new_cluster) {
$com.= " --wsrep-new-cluster";
}
diff --git a/scripts/wsrep_sst_common.sh b/scripts/wsrep_sst_common.sh
index 3b8cce9c467..73a026b4edc 100644
--- a/scripts/wsrep_sst_common.sh
+++ b/scripts/wsrep_sst_common.sh
@@ -28,7 +28,12 @@ WSREP_SST_OPT_PSWD=${WSREP_SST_OPT_PSWD:-}
WSREP_SST_OPT_DEFAULT=""
WSREP_SST_OPT_EXTRA_DEFAULT=""
WSREP_SST_OPT_SUFFIX_DEFAULT=""
+WSREP_SST_OPT_SUFFIX_VALUE=""
+WSREP_SST_OPT_MYSQLD=""
INNODB_DATA_HOME_DIR_ARG=""
+INNODB_LOG_GROUP_HOME_ARG=""
+INNODB_UNDO_DIR_ARG=""
+LOG_BIN_ARG=""
while [ $# -gt 0 ]; do
case "$1" in
@@ -83,6 +88,18 @@ case "$1" in
readonly INNODB_DATA_HOME_DIR_ARG="$2"
shift
;;
+ '--innodb-log-group-home-dir')
+ readonly INNODB_LOG_GROUP_HOME_ARG="$2"
+ shift
+ ;;
+ '--innodb-undo-directory')
+ readonly INNODB_UNDO_DIR_ARG="$2"
+ shift
+ ;;
+ '--log-bin')
+ readonly LOG_BIN_ARG="$2"
+ shift
+ ;;
'--defaults-file')
readonly WSREP_SST_OPT_DEFAULT="$1=$2"
shift
@@ -93,6 +110,7 @@ case "$1" in
;;
'--defaults-group-suffix')
readonly WSREP_SST_OPT_SUFFIX_DEFAULT="$1=$2"
+ readonly WSREP_SST_OPT_SUFFIX_VALUE="$2"
shift
;;
'--host')
@@ -143,6 +161,46 @@ case "$1" in
readonly WSREP_SST_OPT_GTID_DOMAIN_ID="$2"
shift
;;
+ '--mysqld-args')
+ original_cmd=""
+ shift
+ while [ $# -gt 0 ]; do
+ option=${1%%=*}
+ if [ "$option" != "--defaults-file" ]; then
+ value=${1#*=}
+ case "$option" in
+ '--innodb-data-home-dir')
+ if [ -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
+ readonly INNODB_DATA_HOME_DIR_ARG="$value"
+ fi
+ ;;
+ '--innodb-log-group-home-dir')
+ if [ -z "$INNODB_LOG_GROUP_HOME_ARG" ]; then
+ readonly INNODB_LOG_GROUP_HOME_ARG="$value"
+ fi
+ ;;
+ '--innodb-undo-directory')
+ if [ -z "$INNODB_UNDO_DIR_ARG" ]; then
+ readonly INNODB_UNDO_DIR_ARG="$value"
+ fi
+ ;;
+ '--log-bin')
+ if [ -z "$LOG_BIN_ARG" ]; then
+ readonly LOG_BIN_ARG="$value"
+ fi
+ ;;
+ esac
+ if [ -z "$original_cmd" ]; then
+ original_cmd="$1"
+ else
+ original_cmd+=" $1"
+ fi
+ fi
+ shift
+ done
+ readonly WSREP_SST_OPT_MYSQLD="$original_cmd"
+ break
+ ;;
*) # must be command
# usage
# exit 1
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 45a7f32d1ac..ba04c358faa 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -699,8 +699,7 @@ if [[ ${FORCE_FTWRL:-0} -eq 1 ]];then
iopts+=" --no-backup-locks "
fi
-
-INNOEXTRA=""
+INNOEXTRA=$WSREP_SST_OPT_MYSQLD
INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:-""}
# Try to set INNODB_DATA_HOME_DIR from the command line:
@@ -709,6 +708,9 @@ if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
fi
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
+ INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
+fi
+if [ -z "$INNODB_DATA_HOME_DIR" ]; then
INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir '')
fi
if [ ! -z "$INNODB_DATA_HOME_DIR" ]; then
@@ -828,7 +830,9 @@ then
exit 93
fi
- if [[ -z $(parse_cnf --mysqld tmpdir "") && -z $(parse_cnf xtrabackup tmpdir "") ]];then
+ if [[ -z $(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE tmpdir "") && \
+ -z $(parse_cnf --mysqld tmpdir "") && \
+ -z $(parse_cnf xtrabackup tmpdir "") ]]; then
xtmpdir=$(mktemp -d)
tmpopts=" --tmpdir=$xtmpdir "
wsrep_log_info "Using $xtmpdir as xtrabackup temporary directory"
@@ -951,8 +955,24 @@ then
[[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE
ib_home_dir=$INNODB_DATA_HOME_DIR
- ib_log_dir=$(parse_cnf --mysqld innodb-log-group-home-dir "")
- ib_undo_dir=$(parse_cnf --mysqld innodb-undo-directory "")
+
+ # Try to set ib_log_dir from the command line:
+ ib_log_dir=$INNODB_LOG_GROUP_HOME_ARG
+ if [ -z "$ib_log_dir" ]; then
+ ib_log_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir "")
+ fi
+ if [ -z "$ib_log_dir" ]; then
+ ib_log_dir=$(parse_cnf --mysqld innodb-log-group-home-dir "")
+ fi
+
+ # Try to set ib_undo_dir from the command line:
+ ib_undo_dir=$INNODB_UNDO_DIR_ARG
+ if [ -z "$ib_undo_dir" ]; then
+ ib_undo_dir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-undo-directory "")
+ fi
+ if [ -z "$ib_undo_dir" ]; then
+ ib_undo_dir=$(parse_cnf --mysqld innodb-undo-directory "")
+ fi
stagemsg="Joiner-Recv"
@@ -1029,7 +1049,13 @@ then
find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
fi
- tempdir=$(parse_cnf --mysqld log-bin "")
+ tempdir=$LOG_BIN_ARG
+ if [ -z "$tempdir" ]; then
+ tempdir=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE log-bin "")
+ fi
+ if [ -z "$tempdir" ]; then
+ tempdir=$(parse_cnf --mysqld log-bin "")
+ fi
if [[ -n ${tempdir:-} ]];then
binlog_dir=$(dirname $tempdir)
binlog_file=$(basename $tempdir)
diff --git a/scripts/wsrep_sst_rsync.sh b/scripts/wsrep_sst_rsync.sh
index 0e3ef0c923c..068e92c0486 100644
--- a/scripts/wsrep_sst_rsync.sh
+++ b/scripts/wsrep_sst_rsync.sh
@@ -116,8 +116,15 @@ then
fi
WSREP_LOG_DIR=${WSREP_LOG_DIR:-""}
+# Try to set WSREP_LOG_DIR from the command line:
+if [ -z "$WSREP_LOG_DIR" ]; then
+ WSREP_LOG_DIR=$INNODB_LOG_GROUP_HOME_ARG
+fi
# if WSREP_LOG_DIR env. variable is not set, try to get it from my.cnf
if [ -z "$WSREP_LOG_DIR" ]; then
+ WSREP_LOG_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-log-group-home-dir '')
+fi
+if [ -z "$WSREP_LOG_DIR" ]; then
WSREP_LOG_DIR=$(parse_cnf --mysqld innodb-log-group-home-dir '')
fi
@@ -136,6 +143,9 @@ if [ ! -z "$INNODB_DATA_HOME_DIR_ARG" ]; then
fi
# if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
if [ -z "$INNODB_DATA_HOME_DIR" ]; then
+ INNODB_DATA_HOME_DIR=$(parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir '')
+fi
+if [ -z "$INNODB_DATA_HOME_DIR" ]; then
INNODB_DATA_HOME_DIR=$(parse_cnf --mysqld innodb-data-home-dir '')
fi