File tree Expand file tree Collapse file tree
jobs/pxc-replicator/templates/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# it's a bash feature.
66# https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-SECONDS
77SECONDS=0
8+ PATH=" ${PATH} :/var/vcap/packages/percona-xtradb-cluster-<%= p('mysql_version') -%>/bin"
89
9- while [[ $SECONDS -lt < %= p(' monit_startup_timeout' ) %> ]]; do
10+ log " starting post-start, checking replication"
11+ while [[ $SECONDS -lt 300 ]]; do
12+ if mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf <<< " SHOW REPLICA STATUS\G" | grep ' Replica_IO_Running: Yes' ; then
13+ log " IO thread is running"
14+ else
15+ log " IO thread is running"
16+ continue
17+ fi
18+
19+ if mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf <<< " SHOW REPLICA STATUS\G" | grep ' Replica_SQL_Running: Yes' ; then
20+ log " SQL thread is running"
21+ exit 0
22+ else
23+ log " SQL thread not running" && continue
24+ continue
25+ fi
1026 sleep 5
11- mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf <<< " SHOW REPLICA STATUS\G" | grep ' Replica_IO_Running: Yes' || continue
12- mysql --defaults-file=/var/vcap/jobs/pxc-mysql/config/mylogin.cnf <<< " SHOW REPLICA STATUS\G" | grep ' Replica_SQL_Running: Yes' || continue
13- break
1427done
1528
1629log " timed out waiting for replication to report healthy"
You can’t perform that action at this time.
0 commit comments