Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
31f65e0e
Commit
31f65e0e
authored
May 05, 2020
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repman: fix socat not using the right IP address
parent
16365bb4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
software/repman/buildout.hash.cfg
software/repman/buildout.hash.cfg
+2
-2
software/repman/templates/dbjobs.in
software/repman/templates/dbjobs.in
+10
-4
No files found.
software/repman/buildout.hash.cfg
View file @
31f65e0e
...
...
@@ -34,7 +34,7 @@ md5sum = 0eeb24c6aa0760f0d33c4cc2828ddf30
[template-mariadb.cfg]
_update_hash_filename_ = instance-mariadb.cfg.jinja2.in
md5sum =
13e205aa8ae0a041b709db50979abbd4
md5sum =
63af2f4fc184cfc9d09f8b72dee5165a
[template-my-cnf]
_update_hash_filename_ = templates/my.cnf.in
...
...
@@ -58,7 +58,7 @@ md5sum = 99324b56192003254081ef336dcee94c
[dbjobs-in]
_update_hash_filename_ = templates/dbjobs.in
md5sum =
de14f3b2337f66727eed0f14af957779
md5sum =
b04cd05773a12d7cfc1f020f1c19dd45
[mysqld-need-start.sh.in]
_update_hash_filename_ = templates/mysqld-need-start.sh.in
...
...
software/repman/templates/dbjobs.in
View file @
31f65e0e
...
...
@@ -6,6 +6,11 @@ ERROLOG={{ parameter_dict['mysql-dir'] }}/.system/logs/errors.log
SLOWLOG={{ parameter_dict['mysql-dir']}}/.system/logs/sql-slow
BACKUPDIR={{ parameter_dict['mysql-dir'] }}/.system/backup
DATADIR={{ parameter_dict['mysql-dir'] }}/
{% if parameter_dict['use-ipv6'] == True -%}
{% set listen = "TCP6:LISTEN" -%}
{% else -%}
{% set listen = "TCP:LISTEN" -%}
{% endif -%}
export PATH={{ parameter_dict['socat-location'] }}/bin:{{ parameter_dict['mysql-location'] }}/bin:{{ parameter_dict['gzip-location'] }}/bin:$PATH
JOBS=( "xtrabackup" "mariabackup" "error" "slowquery" "zfssnapback" "optimize" "reseedxtrabackup" "reseedmariabackup" "reseedmysqldump" "flashbackxtrabackup" "flashbackmariadbackup" "flashbackmysqldump" "stop" "start")
...
...
@@ -53,6 +58,7 @@ partialRestore()
}
kill -9 $(lsof -t -i:{{ parameter_dict['socat-port'] }} -sTCP:LISTEN)
kill -9 $(lsof -t -i:{{ parameter_dict['socat-port'] }} -sTCP6:LISTEN)
for job in "${JOBS[@]}"
do
...
...
@@ -72,13 +78,13 @@ do
reseedmysqldump)
echo "Waiting backup." > {{ parameter_dict['log-dir'] }}/dbjob.out
pauseJob
socat -u
TCP-LISTEN:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['ipv4
'] }},reuseaddr STDOUT | gunzip | mysql -h{{ parameter_dict['ip'] }} -P{{ parameter_dict['port'] }} -p$PASSWORD -u$USER > {{ parameter_dict['log-dir'] }}/dbjob.out 2>&1
socat -u
{{ listen }}:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['host
'] }},reuseaddr STDOUT | gunzip | mysql -h{{ parameter_dict['ip'] }} -P{{ parameter_dict['port'] }} -p$PASSWORD -u$USER > {{ parameter_dict['log-dir'] }}/dbjob.out 2>&1
mysql --defaults-file={{ parameter_dict['dbjob-cnf'] }} -e 'start slave;'
;;
flashbackmysqldump)
echo "Waiting backup." > {{ parameter_dict['log-dir'] }}/dbjob.out
pauseJob
socat -u
TCP-LISTEN:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['ipv4
'] }},reuseaddr STDOUT | gunzip | mysql -h{{ parameter_dict['ip'] }} -P{{ parameter_dict['port'] }} -p$PASSWORD -u$USER > {{ parameter_dict['log-dir'] }}/dbjob.out 2>&1
socat -u
{{ listen }}:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['host
'] }},reuseaddr STDOUT | gunzip | mysql -h{{ parameter_dict['ip'] }} -P{{ parameter_dict['port'] }} -p$PASSWORD -u$USER > {{ parameter_dict['log-dir'] }}/dbjob.out 2>&1
mysql --defaults-file={{ parameter_dict['dbjob-cnf'] }} -e 'start slave;'
;;
reseedmariabackup)
...
...
@@ -86,7 +92,7 @@ do
mkdir $BACKUPDIR
echo "Waiting backup." > {{ parameter_dict['log-dir'] }}/dbjob.out
pauseJob
socat -u
TCP-LISTEN:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['ipv4
'] }},reuseaddr STDOUT | mbstream -x -C $BACKUPDIR
socat -u
{{ listen }}:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['host
'] }},reuseaddr STDOUT | mbstream -x -C $BACKUPDIR
# mbstream -p, --parallel
mariabackup --prepare --export --target-dir=$BACKUPDIR
partialRestore
...
...
@@ -96,7 +102,7 @@ do
mkdir $BACKUPDIR
echo "Waiting backup." > {{ parameter_dict['log-dir'] }}/dbjob.out
pauseJob
socat -u
TCP-LISTEN:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['ipv4
'] }},reuseaddr STDOUT | xbstream -x -C $BACKUPDIR
socat -u
{{ listen }}:{{ parameter_dict['socat-port'] }},bind={{ parameter_dict['host
'] }},reuseaddr STDOUT | xbstream -x -C $BACKUPDIR
mariabackup --prepare --export --target-dir=$BACKUPDIR
partialRestore
;;
...
...
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