Tracking the Database Restore and Replication Status
There is no need to Enable API Access on the node for this endpoint to function.
To obtain the database restore and replication status, type the URL of the endpoint in your browser. For example: https://<Mashery_Local_Slave_IP>:5480/service/mashery/cgi/replication_status.py
{ "replication_status": { "restore": { "error": false, "errors": "", "log": "1. transfer backup from master\nMon Aug 22 18:38:04 UTC 2016\n\n2. unzip backup\nMon Aug 22 18:38:41 UTC 2016\n\n3. stop slave\nSlave stopped\nMon Aug 22 18:38:41 UTC 2016\n\n4. restore from backup\nMon Aug 22 20:36:18 UTC 2016\n\n5. start slave\nSlave started\nMon Aug 22 20:36:18 UTC 2016\n\n6. done\nMon Aug 22 20:36:18 UTC 2016\n\n", "complete": true }, "replication": { "last_error": "", "seconds_behind_master": "250832\n", "slave_io_running": "Yes\n", "slave_sql_running": "Yes\n" } }, "error": null }
JSON Node | Value in JSON | Description |
---|---|---|
Database restore log | ||
replication_status.restore.log |
Provides database restore log. |
|
replication_status.restore.complete |
true |
Implies that the database restore step is done. |
false |
Implies that the database restore step is not complete. |
|
replication_status.restore.error |
true |
Implies that there are errors during the process. Refer to the replication_status.restore.errors node to get more details for the errors. |
false |
Implies that there are errors during the process. |
|
Database replication status | ||
replication_status.replication |
Provides replication-specific information from “show slave status”. |
|
replication_status. replication.last_error |
<error> |
Provides the details for the errors (if any). |
replication_status.replication. seconds_behind_master |
<time in milliseconds> |
Provides an estimate of how long it takes the slave node to catch up to the master. |
replication_status.replication.slave_io_running or replication_status.replication.slave_sql_running |
No Yes |
Replication is not running and last_error provides the details for the errors (if any). Replication starts, seconds_behind_master provides an estimate of how long it takes the slave node to catch up to the master. |