Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
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
certo
mariadb
Commits
c74b883e
Commit
c74b883e
authored
Nov 18, 2019
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved MySQL server down detection
parent
36ad98ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
mysqlchk
mysqlchk
+13
-0
No files found.
mysqlchk
View file @
c74b883e
...
...
@@ -18,6 +18,7 @@ CHECK_QUERY="select 1"
CHECK_QUERY1="show global status where variable_name='wsrep_local_state'"
CHECK_QUERY2="show global variables where variable_name='read_only'"
CHECK_QUERY3="show global variables where variable_name='wsrep_sst_method'"
CHECK_QUERY4="show global status where variable_name='wsrep_cluster_status'"
GALERA=`/sbin/uci get mariadb.galera.cluster_address`
return_ok()
...
...
@@ -80,6 +81,18 @@ else
fi
fi
status=$($MYSQL_BIN $MYSQL_OPTS --host=$MYSQL_HOST --port=$MYSQL_PORT --user=$MYSQL_USERNAME -e "$CHECK_QUERY4;" 2>/dev/null)
if [ $? -ne 0 ]; then
return_fail;
fi
status=$(echo $status | awk '{print $2;}')
if [ ! "$status" = "Primary" ]; then
return_fail;
fi
return_ok;
else
return_fail;
fi
fi
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