$ ./mysqlrplshow --help
Usage: mysqlrplshow --master=root@localhost:3306 
mysqlrplshow - show slaves attached to a master
  --version             show program's version number and exit
  --help                display a help message and exit
  --master=MASTER       connection information for master server in the form:
                        <user>[:<password>]@<host>[:<port>][:<socket>] or
  -l, --show-list       print a list of the topology.
  -f FORMAT, --format=FORMAT
                        display the list in either grid (default), tab, csv,
                        or vertical format
  -r, --recurse         traverse the list of slaves to find additional
                        master/slave connections. User this option to map a
                        replication topology.
                        limit the traversal to this depth. Valid only with the
                        --recurse option. Valid values are non-negative
  -p, --prompt          prompt for slave user and password if different from
                        master login.
  -n NUM_RETRIES, --num-retries=NUM_RETRIES
                        number of retries allowed for failed slave login
                        attempt. Valid with --prompt only.
  -q, --quiet           turn off all messages for quiet execution.
                        at startup, query master for all registered slaves and
                        use the user name and password specified to connect.
                        Supply the user and password in the form
                        <user>[:<password>] or <login-path>. For example,
                        --discover-slaves-login=joe:secret will use 'joe' as
                        the user and 'secret' as the password for each
                        discovered slave.



$ ./mysqlrplshow --master=slave:slave@hostname_lx:3306 --recurse --discover-slaves-login=slave:slave -l
# master on hostname_lx: ... connected.
# Finding slaves for master: hostname_lx:3306
# master on hostname_lx: ... connected.
# Finding slaves for master: hostname_lx:3406
# master on hostname_lx: ... connected.
# Finding slaves for master: hostname_lx:3506
# Replication Topology Graph
hostname_lx:3306 (MASTER)
   +--- hostname_lx:3406 - (SLAVE + MASTER)
   |   |
   |   +--- hostname_lx:3306 <--> (SLAVE + MASTER)
   +--- hostname_lx:3506 - (SLAVE)
| Master                 | Slave                  |
| hostname_lx:3306  | hostname_lx:3406  |
| hostname_lx:3306  | hostname_lx:3506  |
| hostname_lx:3406  | hostname_lx:3306  |


Post a Comment