SHOW SLAVE HOSTS
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-id option (preferably in
the slave’s options file).
HostThe hostname of the slave server, which is set by the
--report-host option 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-id and conversely on the
slave with the CHANGE MASTER TO statement.