This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-25. For the latest, interactive version please visit https://mariadb.com/kb/.

SHOW REPLICA HOSTS

Syntax

SHOW SLAVE HOSTS
SHOW REPLICA HOSTS -- from MariaDB 10.5.1

Description

This command is run on the primary and displays a list of replicas that are currently registered with it. The output looks like this:

SHOW SLAVE HOSTS;
+------------+-----------+------+-----------+
| Server_id  | Host      | Port | Master_id |
+------------+-----------+------+-----------+
|  192168010 | iconnect2 | 3306 | 192168011 |
| 1921680101 | athena    | 3306 | 192168011 |
+------------+-----------+------+-----------+
  • Server_id: The unique server ID of the replica server, as configured in the server's option file, or on the command line with --server-id=value.
  • Host: The host name of the replica server, as configured in the server's option file, or on the command line with --report-host=host_name (note that this can differ from the machine name as configured in the operating system). Starting in MariaDB 10.5.1, if a replica doesn't configure --report-host explicitly, the value for the Host column is automatically extracted using the network connection's host name or IP address. Prior to 10.5, the Host value is left blank if a replica's --report-host parameter is not configured.
  • Port: The port the replica server is listening on.
  • Master_id: The unique server ID of the primary server that the replica server is replicating from.

Some MariaDB and MySQL versions report another variable, rpl_recovery_rank. This variable was never used, and was eventually removed in MariaDB 10.1.2 .

Requires the REPLICATION MASTER ADMIN privilege (>= MariaDB 10.5.2) or the REPLICATION SLAVE privilege (<= MariaDB 10.5.1).

SHOW REPLICA HOSTS

MariaDB starting with 10.5.1

SHOW REPLICA HOSTS is an alias for SHOW SLAVE HOSTS from MariaDB 10.5.1.

See Also

Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.