Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
606c867e
Commit
606c867e
authored
Sep 11, 2024
by
Julius Goryavsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
galera SST scripts: moving common code to wsrep_sst_common file
parent
4cb73f49
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
172 additions
and
222 deletions
+172
-222
scripts/wsrep_sst_backup.sh
scripts/wsrep_sst_backup.sh
+2
-3
scripts/wsrep_sst_common.sh
scripts/wsrep_sst_common.sh
+100
-2
scripts/wsrep_sst_mariabackup.sh
scripts/wsrep_sst_mariabackup.sh
+3
-86
scripts/wsrep_sst_rsync.sh
scripts/wsrep_sst_rsync.sh
+67
-131
No files found.
scripts/wsrep_sst_backup.sh
View file @
606c867e
...
@@ -21,14 +21,13 @@ set -ue
...
@@ -21,14 +21,13 @@ set -ue
# This is a reference script for rsync-based state snapshot transfer
# This is a reference script for rsync-based state snapshot transfer
OS
=
"
$(
uname
)
"
[
"
$OS
"
=
'Darwin'
]
&&
export
-n
LD_LIBRARY_PATH
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
wsrep_check_datadir
wsrep_check_datadir
DATA
=
"
$WSREP_SST_OPT_DATA
"
DATA
=
"
$WSREP_SST_OPT_DATA
"
create_data
MAGIC_FILE
=
"
$DATA
/backup_sst_complete"
MAGIC_FILE
=
"
$DATA
/backup_sst_complete"
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
[
-f
"
$MAGIC_FILE
"
]
&&
rm
-f
"
$MAGIC_FILE
"
...
...
scripts/wsrep_sst_common.sh
View file @
606c867e
...
@@ -20,8 +20,13 @@
...
@@ -20,8 +20,13 @@
trap
'exit 32'
HUP PIPE
trap
'exit 32'
HUP PIPE
trap
'exit 3'
INT QUIT TERM
trap
'exit 3'
INT QUIT TERM
# Setting the path for some utilities on CentOS
OS
=
"
$(
uname
)
"
export
PATH
=
"
$PATH
:/usr/sbin:/usr/bin:/sbin:/bin"
# Setting the paths for some utilities on CentOS
export
PATH
=
"
${
PATH
:+
$PATH
:
}
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin"
if
[
"
$OS
"
!=
'Darwin'
]
;
then
export
LD_LIBRARY_PATH
=
"
${
LD_LIBRARY_PATH
:+
$LD_LIBRARY_PATH
:
}
/usr/local/lib:/usr/lib:/lib:/opt/lib"
fi
commandex
()
commandex
()
{
{
...
@@ -1724,4 +1729,97 @@ simple_cleanup()
...
@@ -1724,4 +1729,97 @@ simple_cleanup()
exit
$estatus
exit
$estatus
}
}
create_data()
{
OLD_PWD="
$(
pwd
)
"
if [ -n "
$DATA
" -a "
$DATA
" != '.' ]; then
[ ! -d "
$DATA
" ] && mkdir -p "
$DATA
"
cd "
$DATA
"
fi
DATA_DIR="
$(
pwd
)
"
cd "
$OLD_PWD
"
}
create_dirs()
{
local simplify=
${
1
:-
0
}
# if no command line argument and INNODB_DATA_HOME_DIR environment
# variable is not set, try to get it from the my.cnf:
if [ -z "
$INNODB_DATA_HOME_DIR
" ]; then
INNODB_DATA_HOME_DIR=
$(
parse_cnf
'--mysqld'
'innodb-data-home-dir'
)
INNODB_DATA_HOME_DIR=
$(
trim_dir
"
$INNODB_DATA_HOME_DIR
"
)
fi
if [ -n "
$INNODB_DATA_HOME_DIR
" -a "
$INNODB_DATA_HOME_DIR
" != '.' -a
\
"
$INNODB_DATA_HOME_DIR
" != "
$DATA_DIR
" ]
then
# handle both relative and absolute paths:
cd "
$DATA
"
[ ! -d "
$INNODB_DATA_HOME_DIR
" ] && mkdir -p "
$INNODB_DATA_HOME_DIR
"
cd "
$INNODB_DATA_HOME_DIR
"
ib_home_dir="
$(
pwd
)
"
cd "
$OLD_PWD
"
[
$simplify
-ne 0 -a "
$ib_home_dir
" = "
$DATA_DIR
" ] && ib_home_dir=""
fi
# if no command line argument and INNODB_LOG_GROUP_HOME is not set,
# then try to get it from the my.cnf:
if [ -z "
$INNODB_LOG_GROUP_HOME
" ]; then
INNODB_LOG_GROUP_HOME=
$(
parse_cnf
'--mysqld'
'innodb-log-group-home-dir'
)
INNODB_LOG_GROUP_HOME=
$(
trim_dir
"
$INNODB_LOG_GROUP_HOME
"
)
fi
if [ -n "
$INNODB_LOG_GROUP_HOME
" -a "
$INNODB_LOG_GROUP_HOME
" != '.' -a
\
"
$INNODB_LOG_GROUP_HOME
" != "
$DATA_DIR
" ]
then
# handle both relative and absolute paths:
cd "
$DATA
"
[ ! -d "
$INNODB_LOG_GROUP_HOME
" ] && mkdir -p "
$INNODB_LOG_GROUP_HOME
"
cd "
$INNODB_LOG_GROUP_HOME
"
ib_log_dir="
$(
pwd
)
"
cd "
$OLD_PWD
"
[
$simplify
-ne 0 -a "
$ib_log_dir
" = "
$DATA_DIR
" ] && ib_log_dir=""
fi
# if no command line argument and INNODB_UNDO_DIR is not set,
# then try to get it from the my.cnf:
if [ -z "
$INNODB_UNDO_DIR
" ]; then
INNODB_UNDO_DIR=
$(
parse_cnf
'--mysqld'
'innodb-undo-directory'
)
INNODB_UNDO_DIR=
$(
trim_dir
"
$INNODB_UNDO_DIR
"
)
fi
if [ -n "
$INNODB_UNDO_DIR
" -a "
$INNODB_UNDO_DIR
" != '.' -a
\
"
$INNODB_UNDO_DIR
" != "
$DATA_DIR
" ]
then
# handle both relative and absolute paths:
cd "
$DATA
"
[ ! -d "
$INNODB_UNDO_DIR
" ] && mkdir -p "
$INNODB_UNDO_DIR
"
cd "
$INNODB_UNDO_DIR
"
ib_undo_dir="
$(
pwd
)
"
cd "
$OLD_PWD
"
[
$simplify
-ne 0 -a "
$ib_undo_dir
" = "
$DATA_DIR
" ] && ib_undo_dir=""
fi
# if no command line argument then try to get it from the my.cnf:
if [ -z "
$ARIA_LOG_DIR
" ]; then
ARIA_LOG_DIR=
$(
parse_cnf
'--mysqld'
'aria-log-dir-path'
)
ARIA_LOG_DIR=
$(
trim_dir
"
$ARIA_LOG_DIR
"
)
fi
if [ -n "
$ARIA_LOG_DIR
" -a "
$ARIA_LOG_DIR
" != '.' -a
\
"
$ARIA_LOG_DIR
" != "
$DATA_DIR
" ]
then
# handle both relative and absolute paths:
cd "
$DATA
"
[ ! -d "
$ARIA_LOG_DIR
" ] && mkdir -p "
$ARIA_LOG_DIR
"
cd "
$ARIA_LOG_DIR
"
ar_log_dir="
$(
pwd
)
"
cd "
$OLD_PWD
"
[
$simplify
-ne 0 -a "
$ar_log_dir
" = "
$DATA_DIR
" ] && ar_log_dir=""
fi
}
wsrep_log_info "
$WSREP_METHOD
$WSREP_TRANSFER_TYPE
started on
$WSREP_SST_OPT_ROLE
"
wsrep_log_info "
$WSREP_METHOD
$WSREP_TRANSFER_TYPE
started on
$WSREP_SST_OPT_ROLE
"
scripts/wsrep_sst_mariabackup.sh
View file @
606c867e
...
@@ -23,8 +23,6 @@ set -ue
...
@@ -23,8 +23,6 @@ set -ue
# https://mariadb.com/kb/en/mariabackup-overview/
# https://mariadb.com/kb/en/mariabackup-overview/
# Make sure to read that before proceeding!
# Make sure to read that before proceeding!
OS
=
"
$(
uname
)
"
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
wsrep_check_datadir
wsrep_check_datadir
...
@@ -935,15 +933,7 @@ if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -F -- '--version-check'; then
...
@@ -935,15 +933,7 @@ if "$BACKUP_BIN" --help 2>/dev/null | grep -qw -F -- '--version-check'; then
disver
=
' --no-version-check'
disver
=
' --no-version-check'
fi
fi
OLD_PWD
=
"
$(
pwd
)
"
create_data
if
[
-n
"
$DATA
"
-a
"
$DATA
"
!=
'.'
]
;
then
[
!
-d
"
$DATA
"
]
&&
mkdir
-p
"
$DATA
"
cd
"
$DATA
"
fi
DATA_DIR
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
if
[
$ssyslog
-eq
1
]
;
then
if
[
$ssyslog
-eq
1
]
;
then
if
[
-n
"
$(
commandex logger
)
"
]
;
then
if
[
-n
"
$(
commandex logger
)
"
]
;
then
...
@@ -1249,85 +1239,12 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
...
@@ -1249,85 +1239,12 @@ if [ "$WSREP_SST_OPT_ROLE" = 'donor' ]; then
else
# joiner
else
# joiner
create_dirs 1
[
-e
"
$SST_PROGRESS_FILE
"
]
&&
\
[
-e
"
$SST_PROGRESS_FILE
"
]
&&
\
wsrep_log_info
"Stale sst_in_progress file:
$SST_PROGRESS_FILE
"
wsrep_log_info
"Stale sst_in_progress file:
$SST_PROGRESS_FILE
"
[
-n
"
$SST_PROGRESS_FILE
"
]
&&
touch
"
$SST_PROGRESS_FILE
"
[
-n
"
$SST_PROGRESS_FILE
"
]
&&
touch
"
$SST_PROGRESS_FILE
"
# if no command line argument and INNODB_DATA_HOME_DIR environment
# variable is not set, try to get it from the my.cnf:
if
[
-z
"
$INNODB_DATA_HOME_DIR
"
]
;
then
INNODB_DATA_HOME_DIR
=
$(
parse_cnf
'--mysqld'
'innodb-data-home-dir'
)
INNODB_DATA_HOME_DIR
=
$(
trim_dir
"
$INNODB_DATA_HOME_DIR
"
)
fi
if
[
-n
"
$INNODB_DATA_HOME_DIR
"
-a
"
$INNODB_DATA_HOME_DIR
"
!=
'.'
-a
\
"
$INNODB_DATA_HOME_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_DATA_HOME_DIR
"
]
&&
mkdir
-p
"
$INNODB_DATA_HOME_DIR
"
cd
"
$INNODB_DATA_HOME_DIR
"
ib_home_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
[
"
$ib_home_dir
"
=
"
$DATA_DIR
"
]
&&
ib_home_dir
=
""
fi
# if no command line argument and INNODB_LOG_GROUP_HOME is not set,
# then try to get it from the my.cnf:
if
[
-z
"
$INNODB_LOG_GROUP_HOME
"
]
;
then
INNODB_LOG_GROUP_HOME
=
$(
parse_cnf
'--mysqld'
'innodb-log-group-home-dir'
)
INNODB_LOG_GROUP_HOME
=
$(
trim_dir
"
$INNODB_LOG_GROUP_HOME
"
)
fi
if
[
-n
"
$INNODB_LOG_GROUP_HOME
"
-a
"
$INNODB_LOG_GROUP_HOME
"
!=
'.'
-a
\
"
$INNODB_LOG_GROUP_HOME
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_LOG_GROUP_HOME
"
]
&&
mkdir
-p
"
$INNODB_LOG_GROUP_HOME
"
cd
"
$INNODB_LOG_GROUP_HOME
"
ib_log_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
[
"
$ib_log_dir
"
=
"
$DATA_DIR
"
]
&&
ib_log_dir
=
""
fi
# if no command line argument and INNODB_UNDO_DIR is not set,
# then try to get it from the my.cnf:
if
[
-z
"
$INNODB_UNDO_DIR
"
]
;
then
INNODB_UNDO_DIR
=
$(
parse_cnf
'--mysqld'
'innodb-undo-directory'
)
INNODB_UNDO_DIR
=
$(
trim_dir
"
$INNODB_UNDO_DIR
"
)
fi
if
[
-n
"
$INNODB_UNDO_DIR
"
-a
"
$INNODB_UNDO_DIR
"
!=
'.'
-a
\
"
$INNODB_UNDO_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_UNDO_DIR
"
]
&&
mkdir
-p
"
$INNODB_UNDO_DIR
"
cd
"
$INNODB_UNDO_DIR
"
ib_undo_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
[
"
$ib_undo_dir
"
=
"
$DATA_DIR
"
]
&&
ib_undo_dir
=
""
fi
# if no command line argument then try to get it from the my.cnf:
if
[
-z
"
$ARIA_LOG_DIR
"
]
;
then
ARIA_LOG_DIR
=
$(
parse_cnf
'--mysqld'
'aria-log-dir-path'
)
ARIA_LOG_DIR
=
$(
trim_dir
"
$ARIA_LOG_DIR
"
)
fi
if
[
-n
"
$ARIA_LOG_DIR
"
-a
"
$ARIA_LOG_DIR
"
!=
'.'
-a
\
"
$ARIA_LOG_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$ARIA_LOG_DIR
"
]
&&
mkdir
-p
"
$ARIA_LOG_DIR
"
cd
"
$ARIA_LOG_DIR
"
ar_log_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
[
"
$ar_log_dir
"
=
"
$DATA_DIR
"
]
&&
ar_log_dir
=
""
fi
if
[
-n
"
$backup_threads
"
]
;
then
if
[
-n
"
$backup_threads
"
]
;
then
impts
=
"--parallel=
$backup_threads
${
impts
:+
}
$impts
"
impts
=
"--parallel=
$backup_threads
${
impts
:+
}
$impts
"
fi
fi
...
...
scripts/wsrep_sst_rsync.sh
View file @
606c867e
...
@@ -21,17 +21,14 @@ set -ue
...
@@ -21,17 +21,14 @@ set -ue
# This is a reference script for rsync-based state snapshot transfer
# This is a reference script for rsync-based state snapshot transfer
RSYNC_REAL_PID
=
0
# rsync process id
STUNNEL_REAL_PID
=
0
# stunnel process id
OS
=
"
$(
uname
)
"
[
"
$OS
"
=
'Darwin'
]
&&
export
-n
LD_LIBRARY_PATH
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
.
$(
dirname
"
$0
"
)
/wsrep_sst_common
wsrep_check_datadir
wsrep_check_datadir
wsrep_check_programs rsync
wsrep_check_programs rsync
RSYNC_REAL_PID
=
0
# rsync process id
STUNNEL_REAL_PID
=
0
# stunnel process id
cleanup_joiner
()
cleanup_joiner
()
{
{
# Since this is invoked just after exit NNN
# Since this is invoked just after exit NNN
...
@@ -162,15 +159,7 @@ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
...
@@ -162,15 +159,7 @@ if [ -n "$WSREP_SST_OPT_BINLOG" ]; then
binlog_base
=
$(
basename
"
$WSREP_SST_OPT_BINLOG
"
)
binlog_base
=
$(
basename
"
$WSREP_SST_OPT_BINLOG
"
)
fi
fi
OLD_PWD
=
"
$(
pwd
)
"
create_data
if
[
-n
"
$DATA
"
-a
"
$DATA
"
!=
'.'
]
;
then
[
!
-d
"
$DATA
"
]
&&
mkdir
-p
"
$DATA
"
cd
"
$DATA
"
fi
DATA_DIR
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
BINLOG_TAR_FILE
=
"
$DATA_DIR
/wsrep_sst_binlog.tar"
BINLOG_TAR_FILE
=
"
$DATA_DIR
/wsrep_sst_binlog.tar"
...
@@ -179,77 +168,6 @@ ib_log_dir="$DATA_DIR"
...
@@ -179,77 +168,6 @@ ib_log_dir="$DATA_DIR"
ib_home_dir
=
"
$DATA_DIR
"
ib_home_dir
=
"
$DATA_DIR
"
ib_undo_dir
=
"
$DATA_DIR
"
ib_undo_dir
=
"
$DATA_DIR
"
# if no command line argument and INNODB_LOG_GROUP_HOME is not set,
# then try to get it from the my.cnf:
if
[
-z
"
$INNODB_LOG_GROUP_HOME
"
]
;
then
INNODB_LOG_GROUP_HOME
=
$(
parse_cnf
'--mysqld'
'innodb-log-group-home-dir'
)
INNODB_LOG_GROUP_HOME
=
$(
trim_dir
"
$INNODB_LOG_GROUP_HOME
"
)
fi
if
[
-n
"
$INNODB_LOG_GROUP_HOME
"
-a
"
$INNODB_LOG_GROUP_HOME
"
!=
'.'
-a
\
"
$INNODB_LOG_GROUP_HOME
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_LOG_GROUP_HOME
"
]
&&
mkdir
-p
"
$INNODB_LOG_GROUP_HOME
"
cd
"
$INNODB_LOG_GROUP_HOME
"
ib_log_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
fi
# if no command line argument and INNODB_DATA_HOME_DIR environment
# variable is not set, try to get it from the my.cnf:
if
[
-z
"
$INNODB_DATA_HOME_DIR
"
]
;
then
INNODB_DATA_HOME_DIR
=
$(
parse_cnf
'--mysqld'
'innodb-data-home-dir'
)
INNODB_DATA_HOME_DIR
=
$(
trim_dir
"
$INNODB_DATA_HOME_DIR
"
)
fi
if
[
-n
"
$INNODB_DATA_HOME_DIR
"
-a
"
$INNODB_DATA_HOME_DIR
"
!=
'.'
-a
\
"
$INNODB_DATA_HOME_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_DATA_HOME_DIR
"
]
&&
mkdir
-p
"
$INNODB_DATA_HOME_DIR
"
cd
"
$INNODB_DATA_HOME_DIR
"
ib_home_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
fi
# if no command line argument and INNODB_UNDO_DIR is not set,
# then try to get it from the my.cnf:
if
[
-z
"
$INNODB_UNDO_DIR
"
]
;
then
INNODB_UNDO_DIR
=
$(
parse_cnf
'--mysqld'
'innodb-undo-directory'
)
INNODB_UNDO_DIR
=
$(
trim_dir
"
$INNODB_UNDO_DIR
"
)
fi
if
[
-n
"
$INNODB_UNDO_DIR
"
-a
"
$INNODB_UNDO_DIR
"
!=
'.'
-a
\
"
$INNODB_UNDO_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$INNODB_UNDO_DIR
"
]
&&
mkdir
-p
"
$INNODB_UNDO_DIR
"
cd
"
$INNODB_UNDO_DIR
"
ib_undo_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
fi
# if no command line argument then try to get it from the my.cnf:
if
[
-z
"
$ARIA_LOG_DIR
"
]
;
then
ARIA_LOG_DIR
=
$(
parse_cnf
'--mysqld'
'aria-log-dir-path'
)
ARIA_LOG_DIR
=
$(
trim_dir
"
$ARIA_LOG_DIR
"
)
fi
if
[
-n
"
$ARIA_LOG_DIR
"
-a
"
$ARIA_LOG_DIR
"
!=
'.'
-a
\
"
$ARIA_LOG_DIR
"
!=
"
$DATA_DIR
"
]
then
# handle both relative and absolute paths:
cd
"
$DATA
"
[
!
-d
"
$ARIA_LOG_DIR
"
]
&&
mkdir
-p
"
$ARIA_LOG_DIR
"
cd
"
$ARIA_LOG_DIR
"
ar_log_dir
=
"
$(
pwd
)
"
cd
"
$OLD_PWD
"
fi
encgroups
=
'--mysqld|sst'
encgroups
=
'--mysqld|sst'
check_server_ssl_config
check_server_ssl_config
...
@@ -598,65 +516,81 @@ FILTER="-f '- /lost+found'
...
@@ -598,65 +516,81 @@ FILTER="-f '- /lost+found'
wsrep_log_info
"Transfer of normal directories done"
wsrep_log_info
"Transfer of normal directories done"
# Transfer InnoDB data files
if
[
-d
"
$ib_home_dir
"
]
;
then
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /ibdata*'
-f
'+ /ib_lru_dump'
\
-f
'- **'
"
$ib_home_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-data_dir"
>
&2
||
RC
=
$?
if
[
$RC
-ne
0
]
;
then
# Transfer InnoDB data files
wsrep_log_error
"rsync innodb_data_home_dir returned code
$RC
:"
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
exit
255
# unknown error
--owner
--group
--perms
--links
--specials
\
fi
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /ibdata*'
-f
'+ /ib_lru_dump'
\
-f
'- **'
"
$ib_home_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-data_dir"
>
&2
||
RC
=
$?
wsrep_log_info
"Transfer of InnoDB data files done"
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync innodb_data_home_dir returned code
$RC
:"
exit
255
# unknown error
fi
# second, we transfer InnoDB log files
wsrep_log_info
"Transfer of InnoDB data files done"
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /ib_logfile[0-9]*'
\
-f
'- **'
"
$ib_log_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-log_dir"
>
&2
||
RC
=
$?
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync innodb_log_group_home_dir returned code
$RC
:"
exit
255
# unknown error
fi
fi
wsrep_log_info
"Transfer of InnoDB log files done"
if
[
-d
"
$ib_log_dir
"
]
;
then
# third, we transfer InnoDB undo logs
# second, we transfer InnoDB log files
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
--owner
--group
--perms
--links
--specials
\
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /undo*'
\
$WHOLE_FILE_OPT
-f
'+ /ib_logfile[0-9]*'
\
-f
'- **'
"
$ib_undo_dir
/"
\
-f
'- **'
"
$ib_log_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-undo_dir"
>
&2
||
RC
=
$?
"rsync://
$WSREP_SST_OPT_ADDR
-log_dir"
>
&2
||
RC
=
$?
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync innodb_log_group_home_dir returned code
$RC
:"
exit
255
# unknown error
fi
wsrep_log_info
"Transfer of InnoDB log files done"
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync innodb_undo_dir returned code
$RC
:"
exit
255
# unknown error
fi
fi
wsrep_log_info
"Transfer of InnoDB undo logs done"
if
[
"
$ib_undo_dir
"
]
;
then
# fourth, we transfer Aria logs
# third, we transfer InnoDB undo logs
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
--owner
--group
--perms
--links
--specials
\
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /aria_log_control'
-f
'+ /aria_log.*'
\
$WHOLE_FILE_OPT
-f
'+ /undo*'
\
-f
'- **'
"
$ar_log_dir
/"
\
-f
'- **'
"
$ib_undo_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-aria_log"
>
&2
||
RC
=
$?
"rsync://
$WSREP_SST_OPT_ADDR
-undo_dir"
>
&2
||
RC
=
$?
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync innodb_undo_dir returned code
$RC
:"
exit
255
# unknown error
fi
wsrep_log_info
"Transfer of InnoDB undo logs done"
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync aria_log_dir_path returned code
$RC
:"
exit
255
# unknown error
fi
fi
wsrep_log_info
"Transfer of Aria logs done"
if
[
"
$ar_log_dir
"
]
;
then
# fourth, we transfer Aria logs
rsync
${
STUNNEL
:+--rsh
=
"
$STUNNEL
"
}
\
--owner
--group
--perms
--links
--specials
\
--ignore-times
--inplace
--dirs
--delete
--quiet
\
$WHOLE_FILE_OPT
-f
'+ /aria_log_control'
-f
'+ /aria_log.*'
\
-f
'- **'
"
$ar_log_dir
/"
\
"rsync://
$WSREP_SST_OPT_ADDR
-aria_log"
>
&2
||
RC
=
$?
if
[
$RC
-ne
0
]
;
then
wsrep_log_error
"rsync aria_log_dir_path returned code
$RC
:"
exit
255
# unknown error
fi
wsrep_log_info
"Transfer of Aria logs done"
fi
# then, we parallelize the transfer of database directories,
# then, we parallelize the transfer of database directories,
# use '.' so that path concatenation works:
# use '.' so that path concatenation works:
...
@@ -744,6 +678,8 @@ else # joiner
...
@@ -744,6 +678,8 @@ else # joiner
check_sockets_utils
check_sockets_utils
create_dirs
ADDR
=
"
$WSREP_SST_OPT_HOST
"
ADDR
=
"
$WSREP_SST_OPT_HOST
"
RSYNC_PORT
=
"
$WSREP_SST_OPT_PORT
"
RSYNC_PORT
=
"
$WSREP_SST_OPT_PORT
"
RSYNC_ADDR
=
"
$WSREP_SST_OPT_HOST
"
RSYNC_ADDR
=
"
$WSREP_SST_OPT_HOST
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment