678
678
679
679
INNOEXTRA=" "
680
680
681
+ INNODB_DATA_HOME_DIR=${INNODB_DATA_HOME_DIR:- " " }
682
+ # Try to set INNODB_DATA_HOME_DIR from the command line:
683
+ if [ ! -z " $INNODB_DATA_HOME_DIR_ARG " ]; then
684
+ INNODB_DATA_HOME_DIR=$INNODB_DATA_HOME_DIR_ARG
685
+ fi
686
+ # if INNODB_DATA_HOME_DIR env. variable is not set, try to get it from my.cnf
687
+ if [ -z " $INNODB_DATA_HOME_DIR " ]; then
688
+ INNODB_DATA_HOME_DIR=$( parse_cnf mysqld$WSREP_SST_OPT_SUFFIX_VALUE innodb-data-home-dir ' ' )
689
+ fi
690
+ if [ -z " $INNODB_DATA_HOME_DIR " ]; then
691
+ INNODB_DATA_HOME_DIR=$( parse_cnf --mysqld innodb-data-home-dir " " )
692
+ fi
693
+ if [ ! -z " $INNODB_DATA_HOME_DIR " ]; then
694
+ INNOEXTRA+=" --innodb-data-home-dir=$INNODB_DATA_HOME_DIR "
695
+ fi
696
+
697
+ if [ -n " $INNODB_DATA_HOME_DIR " ]; then
698
+ # handle both relative and absolute paths
699
+ INNODB_DATA_HOME_DIR=$( cd $DATA ; mkdir -p " $INNODB_DATA_HOME_DIR " ; cd $INNODB_DATA_HOME_DIR ; pwd -P)
700
+ else
701
+ # default to datadir
702
+ INNODB_DATA_HOME_DIR=$( cd $DATA ; pwd -P)
703
+ fi
704
+
681
705
if [[ $ssyslog -eq 1 ]]; then
682
706
683
707
if ! command -v logger > /dev/null; then
@@ -698,13 +722,13 @@ if [[ $ssyslog -eq 1 ]];then
698
722
logger -p daemon.info -t ${ssystag} wsrep-sst-$WSREP_SST_OPT_ROLE " $@ "
699
723
}
700
724
701
- INNOAPPLY=" ${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$ rebuildcmd \$ {DATA} 2>&1 | logger -p daemon.err -t ${ssystag} innobackupex-apply "
725
+ INNOAPPLY=" ${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$ INNOEXTRA --apply-log \$ rebuildcmd \$ {DATA} 2>&1 | logger -p daemon.err -t ${ssystag} innobackupex-apply "
702
726
INNOMOVE=" ${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \$ {DATA} 2>&1 | logger -p daemon.err -t ${ssystag} innobackupex-move "
703
727
INNOBACKUP=" ${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$ tmpopts \$ INNOEXTRA --galera-info --stream=\$ sfmt \$ itmpdir 2> >(logger -p daemon.err -t ${ssystag} innobackupex-backup)"
704
728
fi
705
729
706
730
else
707
- INNOAPPLY=" ${INNOBACKUPEX_BIN} --innobackupex $disver $iapts --apply-log \$ rebuildcmd \$ {DATA} &>\$ {DATA}/innobackup.prepare.log"
731
+ INNOAPPLY=" ${INNOBACKUPEX_BIN} --innobackupex $disver $iapts \$ INNOEXTRA --apply-log \$ rebuildcmd \$ {DATA} &>\$ {DATA}/innobackup.prepare.log"
708
732
INNOMOVE=" ${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $impts --move-back --force-non-empty-directories \$ {DATA} &>\$ {DATA}/innobackup.move.log"
709
733
INNOBACKUP=" ${INNOBACKUPEX_BIN} --innobackupex ${WSREP_SST_OPT_CONF} $disver $iopts \$ tmpopts \$ INNOEXTRA --galera-info --stream=\$ sfmt \$ itmpdir 2>\$ {DATA}/innobackup.backup.log"
710
734
fi
847
871
[[ -e $SST_PROGRESS_FILE ]] && wsrep_log_info " Stale sst_in_progress file: $SST_PROGRESS_FILE "
848
872
[[ -n $SST_PROGRESS_FILE ]] && touch $SST_PROGRESS_FILE
849
873
850
- ib_home_dir=$( parse_cnf mysqld innodb-data-home-dir " " )
874
+ ib_home_dir=$INNODB_DATA_HOME_DIR
851
875
ib_log_dir=$( parse_cnf mysqld innodb-log-group-home-dir " " )
852
876
ib_undo_dir=$( parse_cnf mysqld innodb-undo-directory " " )
853
877
0 commit comments