github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/scripts/replica-lag-set.sh (about)

     1  #!/bin/bash
     2  
     3  stmt="STOP SLAVE SQL_THREAD FOR CHANNEL '';CHANGE MASTER TO MASTER_DELAY = $1;START SLAVE SQL_THREAD FOR CHANNEL '';SHOW SLAVE STATUS\G;"
     4  docker exec mattermost-mysql-read-replica sh -c "export MYSQL_PWD=mostest; mysql -u root -e \"$stmt\"" | grep SQL_Delay