mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-27 07:54:58 +00:00
PT-80 Added support for slave status in pt-stalk
This commit is contained in:
34
bin/pt-stalk
34
bin/pt-stalk
@@ -832,6 +832,8 @@ collect() {
|
||||
log "Could not find the MySQL error log"
|
||||
fi
|
||||
|
||||
slave_status "$d/$p-slave-status" $mysql_version
|
||||
|
||||
if [ "${mysql_version}" '>' "5.1" ]; then
|
||||
local mutex="SHOW ENGINE INNODB MUTEX"
|
||||
else
|
||||
@@ -1062,6 +1064,38 @@ tokudb_status() {
|
||||
>> "$d/$p-tokudbstatus$n" || rm -f "$d/$p-tokudbstatus$n"
|
||||
}
|
||||
|
||||
slave_status() {
|
||||
local outfile=$1
|
||||
local mysql_version=$2
|
||||
|
||||
if [ "${mysql_version}" '<' "5.7" ]; then
|
||||
echo "MySQL < 5.7 detected"
|
||||
local status="SHOW SLAVE STATUS\G"
|
||||
$CMD_MYSQL $EXT_ARGV -e "$status" >> $outfile
|
||||
else
|
||||
local status="
|
||||
SELECT *
|
||||
FROM performance_schema.replication_connection_configuration
|
||||
JOIN performance_schema.replication_applier_configuration
|
||||
USING (channel_name)\G"
|
||||
echo -e "\n$status\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$status" >> $outfile
|
||||
|
||||
local status="SELECT *
|
||||
FROM replication_connection_status\G"
|
||||
echo -e "\n$status\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$status" >> $outfile
|
||||
|
||||
local status="SELECT *
|
||||
FROM replication_applier_status
|
||||
JOIN replication_applier_status_by_coordinator
|
||||
USING (channel_name)\G"
|
||||
echo -e "\n$status\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$status" >> $outfile
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
innodb_status() {
|
||||
local n=$1
|
||||
|
||||
|
@@ -30,3 +30,5 @@ lower_case_table_names = 0
|
||||
|
||||
# fkc test
|
||||
binlog_format = STATEMENT
|
||||
|
||||
performance_schema=ON
|
||||
|
Reference in New Issue
Block a user