summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-03-20 22:35:19 +0100
committerSergei Golubchik <serg@mariadb.org>2018-03-23 00:55:19 +0100
commita15ab358fc1ea75634de266fa8150b3e89ac5593 (patch)
tree59c54a2acf926a613196dea6914e060966968925 /scripts
parent89b0d5cb6e3db2736cdc5b66fd1f24e4455bc634 (diff)
downloadmariadb-git-a15ab358fc1ea75634de266fa8150b3e89ac5593.tar.gz
wsrep_sst scripts: support traditional netcat
Diffstat (limited to 'scripts')
-rw-r--r--scripts/wsrep_sst_mariabackup.sh18
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh19
-rw-r--r--scripts/wsrep_sst_xtrabackup.sh18
3 files changed, 48 insertions, 7 deletions
diff --git a/scripts/wsrep_sst_mariabackup.sh b/scripts/wsrep_sst_mariabackup.sh
index 9e3fc54290d..549161aa8f3 100644
--- a/scripts/wsrep_sst_mariabackup.sh
+++ b/scripts/wsrep_sst_mariabackup.sh
@@ -179,12 +179,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat;then
+ # Ncat
tcmd="nc -l ${TSST_PORT}"
- else
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
tcmd="nc -dl ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc -l -p ${TSST_PORT}"
fi
else
- tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ if nc -h 2>&1 | grep -q ncat;then
+ # Ncat
+ tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
+ tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc -q0 ${REMOTEIP} ${TSST_PORT}"
+ fi
fi
else
tfmt='socat'
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 9104daf19bc..00efdaeebcf 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -268,13 +268,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat; then
+ # Ncat
tcmd="nc $sockopt -l ${TSST_PORT}"
- else
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
tcmd="nc $sockopt -dl ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc $sockopt -l -p ${TSST_PORT}"
fi
else
- # netcat doesn't understand [] around IPv6 address
- tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ if nc -h 2>&1 | grep -q ncat;then
+ # Ncat
+ tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
+ tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc -q0 ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ fi
fi
else
tfmt='socat'
diff --git a/scripts/wsrep_sst_xtrabackup.sh b/scripts/wsrep_sst_xtrabackup.sh
index 867aab622ed..628c1f8b06c 100644
--- a/scripts/wsrep_sst_xtrabackup.sh
+++ b/scripts/wsrep_sst_xtrabackup.sh
@@ -144,12 +144,26 @@ get_transfer()
wsrep_log_info "Using netcat as streamer"
if [[ "$WSREP_SST_OPT_ROLE" == "joiner" ]];then
if nc -h 2>&1 | grep -q ncat;then
+ # Ncat
tcmd="nc -l ${TSST_PORT}"
- else
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
tcmd="nc -dl ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc -l -p ${TSST_PORT}"
fi
else
- tcmd="nc ${WSREP_SST_OPT_HOST_UNESCAPED} ${TSST_PORT}"
+ if nc -h 2>&1 | grep -q ncat;then
+ # Ncat
+ tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ elif nc -h 2>&1 | grep -q -- '-d\>';then
+ # Debian netcat
+ tcmd="nc ${REMOTEIP} ${TSST_PORT}"
+ else
+ # traditional netcat
+ tcmd="nc -q0 ${REMOTEIP} ${TSST_PORT}"
+ fi
fi
else
tfmt='socat'