Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
perun-proxy-utils
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
perun-proxy-utils
Merge requests
!1
"README.md" did not exist on "dd1b2ba461bb86d9cd49c06c6c01d2d4051bd3be"
Db replication check
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Db replication check
github/fork/BaranekD/db_replication_check
into
master
Overview
0
Commits
2
Pipelines
0
Changes
1
Closed
Pavel Břoušek
requested to merge
github/fork/BaranekD/db_replication_check
into
master
6 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
Created by: BaranekD
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
c39f0042
2 commits,
2 years ago
1 file
+
27
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
mariadb_replication_check.sh
0 → 100755
+
27
−
0
Options
#!/bin/bash
USER
=
""
PASSWD
=
""
# Addresses in quotes separated by spaces ("add1" "add2" "add3")
machines
=()
machinesCount
=
${#
machines
[*]
}
for
i
in
$(
seq
0
$(
expr
$machinesCount
- 1
))
;
do
result[i]
=
$(
mysql
-u
${
USER
}
-p
${
PASSWD
}
-h
${
machines
[i]
}
--execute
=
"SHOW STATUS LIKE 'wsrep_last_committed';"
2> /dev/null |
tr
-dc
'0-9'
)
done
for
i
in
$(
seq
0
$(
expr
$machinesCount
- 1
))
;
do
if
[[
-z
${
result
[i]
}
]]
;
then
echo
"2 mariadb_replication_check -
${
machines
[i]
}
: An error appeared while connecting mariadb."
exit
fi
done
for
i
in
$(
seq
0
$(
expr
$machinesCount
- 2
))
;
do
if
[[
${
result
[i]
}
-ne
${
result
[i+1]
}
]]
;
then
echo
"2 mariadb_replication_check - The result from
${
machines
[1]
}
(
${
result
[i]
}
) is not equal to the result from
${
machines
[i+1]
}
(
${
result
[i+1]
}
)"
exit
fi
done
echo
"0 mariadb_replication_check - OK"
Loading