Name
SHOW SLAVE HOSTS
Synopsis
SHOW SLAVE HOSTS
This statement displays a list of slave servers for the
master server. Slaves must be started with the
--report-host=slave
option in order to be shown. Here is an example:
SHOW SLAVE HOSTS; +------------+-----------+------+-----------+ | Server_id | Host | Port | Master_id | +------------+-----------+------+-----------+ | 2 | slave2 | 3306 | 1 | | 3 | slave3 | 3306 | 1 | +------------+-----------+------+-----------+
Four fields are in the results:
Server_idThe server identification number for the slave server, which is set by the
--server-idoption (preferably in the slave’s options file).HostThe hostname of the slave server, which is set by the
--report-hostoption on the slave.PortThe port on which the slave is listening for replication. This defaults to 3306, but can be set with the CHANGE MASTER TO statement, described earlier in this chapter.
Master_idThe server identification number of the master. It’s set on the master with
--server-idand conversely on the slave with the CHANGE MASTER TO statement.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access