1MYSQLRPLSHOW(1)                 MySQL Utilities                MYSQLRPLSHOW(1)
2
3
4

NAME

6       mysqlrplshow - Show Slaves for Master Server
7

SYNOPSIS

9       mysqlrplshow [options]
10

DESCRIPTION

12       This utility shows the replication slaves for a master. It prints a
13       graph of the master and its slaves labeling each with the host name and
14       port number.
15
16       You must specify the --discover-slaves-login option to provide the user
17       name and password to discover any slaves in the topology.
18
19       To explore the slaves for each client, use the --recurse option. This
20       causes the utility to connect to each slave found and attempt to
21       determine whether it has any slaves. If slaves are found, the process
22       continues until the slave is found in the list of servers serving as
23       masters (a circular topology). The graph displays the topology with
24       successive indents. A notation is made for circular topologies.
25
26       If you use the --recurse option, the utility attempts to connect to the
27       slaves using the user name and password provided for the master. By
28       default, if the connection attempt fails, the utility throws an error
29       and stops. To change this behavior, use the --prompt option, which
30       permits the utility to prompt for the user name and password for each
31       slave that fails to connect. You can also use the --num-retries=n
32       option to reattempt a failed connection 'n' times before the utility
33       fails.
34
35       An example graph for a typical topology with relay slaves is shown
36       here:
37
38           # Replication Topology Graph::
39           localhost:3311 (MASTER)
40              |
41              +--- localhost:3310 - (SLAVE)
42              |
43              +--- localhost:3312 - (SLAVE + MASTER)
44                  |
45                  +--- localhost:3313 - (SLAVE)
46
47       MASTER, SLAVE, and SLAVE+MASTER indicate that a server is a master
48       only, slave only, and both slave and master, respectively.
49
50       A circular replication topology is shown like this, where <-->
51       indicates circularity:
52
53           # Replication Topology Graph
54           localhost:3311 (MASTER)
55              |
56              +--- localhost:3312 - (SLAVE + MASTER)
57                  |
58                  +--- localhost:3313 - (SLAVE + MASTER)
59                      |
60                      +--- localhost:3311 <--> (SLAVE)
61
62       To produce a column list in addition to the graph, specify the
63       --show-list option. In this case, to specify how to display the list,
64       use one of the following values with the --format option:
65
66       ·   grid (default)
67
68           Display output in grid or table format like that of the mysql
69           client command-line tool.
70
71       ·   csv
72
73           Display output in comma-separated values format.
74
75       ·   tab
76
77           Display output in tab-separated format.
78
79       ·   vertical
80
81           Display output in single-column format like that of the \G command
82           for the mysql client command-line tool.
83
84       The utility uses of the SHOW SLAVE HOSTS statement to determine which
85       slaves the master has. If you want to use the --recurse option, slaves
86       should have been started with the --report-host and --report-port
87       options set to their actual host name and port number or the utility
88       may not be able to connect to the slaves to determine their own slaves.
89       OPTIONS.PP mysqlrplshow accepts the following command-line options:
90
91       ·   --help
92
93           Display a help message and exit.
94
95       ·   --license
96
97           Display license information and exit.
98
99       ·   --discover-slaves-login=<slave-login>
100
101           Supply the user and password in the form <user>[:<passwd>] or
102           <login-path> for discovering slaves and relay slaves in the
103           topology. For example, --discover=joe:secret will use 'joe' as the
104           user and 'secret' as the password for each discovered slave.
105
106       ·   --format=<format>, -f<format>
107
108           Specify the display format for column list output. Permitted format
109           values are grid, csv, tab, and vertical. The default is grid. This
110           option applies only if --show-list is given.
111
112       ·   --master=<source>
113
114           Connection information for the master server.
115
116           To connect to a server, it is necessary to specify connection
117           parameters such as user name, host name, password, and either a
118           port or socket. MySQL Utilities provides a number of ways to
119           provide this information. All of the methods require specifying
120           your choice via a command-line option such as --server, --master,
121           --slave, etc. The methods include the following in order of most
122           secure to least secure.
123
124           ·   Use login-paths from your .mylogin.cnf file (encrypted, not
125               visible). Example : <login-path>[:<port>][:<socket>]
126
127           ·   Use a configuration file (unencrypted, not visible) Note:
128               available in release-1.5.0. Example :
129               <configuration-file-path>[:<section>]
130
131           ·   Specify the data on the command-line (unencrypted, visible).
132               Example : <user>[:<passwd>]@<host>[:<port>][:<socket>]
133
134
135       ·   --max-depth=<N>
136
137           The maximum recursion depth. This option is valid only if --recurse
138           is given.
139
140       ·   --num-retries=<num_retries>, -n<num_retries>
141
142           The number of retries permitted for failed slave login attempts.
143           This option is valid only if --prompt is given.
144
145       ·   --prompt, -p
146
147           Prompt for the slave user and password if different from the master
148           user and password.
149
150           If you give this option, the utility sets --num-retries to 1 if
151           that option is not set explicitly. This ensures at least one
152           attempt to retry and prompt for the user name and password should a
153           connection fail.
154
155       ·   --quiet, -q
156
157           Turn off all messages for quiet execution. This option does not
158           suppress errors or warnings.
159
160       ·   --recurse, -r
161
162           Traverse the list of slaves to find additional master/slave
163           connections. User this option to map a replication topology.
164
165       ·   --show-list, -l
166
167           Display a column list of the topology.
168
169       ·   --ssl-ca
170
171           The path to a file that contains a list of trusted SSL CAs.
172
173       ·   --ssl-cert
174
175           The name of the SSL certificate file to use for establishing a
176           secure connection.
177
178       ·   --ssl-cert
179
180           The name of the SSL key file to use for establishing a secure
181           connection.
182
183       ·   --ssl
184
185           Specifies if the server connection requires use of SSL. If an
186           encrypted connection cannot be established, the connection attempt
187           fails. Default setting is 0 (SSL not required).
188
189       ·   --verbose, -v
190
191           Specify how much information to display. If this option is used,
192           the IO thread status of each slave is also displayed. Use this
193           option multiple times to increase the amount of information. For
194           example, -v = verbose, -vv = more verbose, -vvv = debug. If you use
195           -vvv, the output will contain the state of the IO and SQL threads
196           for each slave.
197
198       ·   --version
199
200           Display version information and exit.
201       NOTES.PP The login user must have the REPLICATE SLAVE and REPLICATE
202       CLIENT privileges to successfully execute this utility. Specifically,
203       the login user must have appropriate permissions to execute SHOW SLAVE
204       STATUS, SHOW MASTER STATUS, and SHOW SLAVE HOSTS.
205
206       For the --format option, the permitted values are not case sensitive.
207       In addition, values may be specified as any unambiguous prefix of a
208       valid value. For example, --format=g specifies the grid format. An
209       error occurs if a prefix matches more than one valid value.
210
211       Mixing IP and hostnames is not recommended. The replication-specific
212       utilities will attempt to compare hostnames and IP addresses as aliases
213       for checking slave connectivity to the master. However, if your
214       installation does not support reverse name lookup, the comparison could
215       fail. Without the ability to do a reverse name lookup, the replication
216       utilities could report a false negative that the slave is (not)
217       connected to the master.
218
219       For example, if you setup replication using MASTER_HOST=ubuntu.net on
220       the slave and later connect to the slave with mysqlrplcheck and have
221       the master specified as --master=192.168.0.6 using the valid IP address
222       for ubuntu.net, you must have the ability to do a reverse name lookup
223       to compare the IP (192.168.0.6) and the hostname (ubuntu.net) to
224       determine if they are the same machine.
225
226       The path to the MySQL client tools should be included in the PATH
227       environment variable in order to use the authentication mechanism with
228       login-paths. This will allow the utility to use the my_print_defaults
229       tools which is required to read the login-path values from the login
230       configuration file (.mylogin.cnf).  EXAMPLES.PP To show the slaves for
231       a master running on port 3311 on the local host, use the following
232       command:
233
234           shell> mysqlrplshow  --master=root@localhost:3311 --discover-slaves-login=root
235           # master on localhost: ... connected.
236           # Finding slaves for master: localhost:3311
237           # Replication Topology Graph
238           localhost:3311 (MASTER)
239              |
240              +--- localhost:3310 - (SLAVE)
241              |
242              +--- localhost:3312 - (SLAVE)
243
244       As shown in the example, you must provide valid login information for
245       the master.
246
247       To show additional information about the IO thread status (to confirm
248       if the slaves are really connected to the master) use the option
249       --verbose:
250
251           shell> mysqlrplshow  --master=root@localhost:3311 --discover-slaves-login=root --verbose
252           # master on localhost: ... connected.
253           # Finding slaves for master: localhost:3311
254           # Replication Topology Graph
255           localhost:3311 (MASTER)
256              |
257              +--- localhost:3310 [IO: Yes, SQL: Yes] - (SLAVE)
258              |
259              +--- localhost:3312 [IO: Yes, SQL: Yes] - (SLAVE)
260
261       To show the full replication topology of a master running on the local
262       host, use the following command:
263
264           shell> mysqlrplshow  --master=root@localhost:3311 --recurse --discover-slaves-login=root
265           # master on localhost: ... connected.
266           # Finding slaves for master: localhost:3311
267           # Replication Topology Graph
268           localhost:3311 (MASTER)
269              |
270              +--- localhost:3310 - (SLAVE)
271              |
272              +--- localhost:3312 - (SLAVE + MASTER)
273                  |
274                  +--- localhost:3313 - (SLAVE)
275
276       To show the full replication topology of a master running on the local
277       host, prompting for the user name and password for slaves that do not
278       have the same user name and password credentials as the master, use the
279       following command:
280
281           shell> mysqlrplshow --recurse --prompt --num-retries=1 \
282                     --master=root@localhost:3331 --discover-slaves-login=root
283           Server localhost:3331 is running on localhost.
284           # master on localhost: ... connected.
285           # Finding slaves for master: localhost:3331
286           Server localhost:3332 is running on localhost.
287           # master on localhost: ... FAILED.
288           Connection to localhost:3332 has failed.
289           Please enter the following information to connect to this server.
290           User name: root
291           Password:
292           # master on localhost: ... connected.
293           # Finding slaves for master: localhost:3332
294           Server localhost:3333 is running on localhost.
295           # master on localhost: ... FAILED.
296           Connection to localhost:3333 has failed.
297           Please enter the following information to connect to this server.
298           User name: root
299           Password:
300           # master on localhost: ... connected.
301           # Finding slaves for master: localhost:3333
302           Server localhost:3334 is running on localhost.
303           # master on localhost: ... FAILED.
304           Connection to localhost:3334 has failed.
305           Please enter the following information to connect to this server.
306           User name: root
307           Password:
308           # master on localhost: ... connected.
309           # Finding slaves for master: localhost:3334
310           # Replication Topology Graph
311           localhost:3331 (MASTER)
312              |
313              +--- localhost:3332 - (SLAVE)
314              |
315              +--- localhost:3333 - (SLAVE + MASTER)
316                  |
317                  +--- localhost:3334 - (SLAVE)
318
319       PERMISSIONS REQUIRED.PP The user connected to the master must have the
320       REPLICATION SLAVE privilege.
321
322       The user specified with the --discover-slaves-login option that logs
323       into each slave must have the REPLICATION CLIENT privilege.
324
326       Copyright © 2006, 2015, Oracle and/or its affiliates. All rights
327       reserved.
328
329       This documentation is free software; you can redistribute it and/or
330       modify it only under the terms of the GNU General Public License as
331       published by the Free Software Foundation; version 2 of the License.
332
333       This documentation is distributed in the hope that it will be useful,
334       but WITHOUT ANY WARRANTY; without even the implied warranty of
335       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
336       General Public License for more details.
337
338       You should have received a copy of the GNU General Public License along
339       with the program; if not, write to the Free Software Foundation, Inc.,
340       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
341       http://www.gnu.org/licenses/.
342
343

SEE ALSO

345       For more information, please refer to the MySQL Utilities and Fabric
346       documentation, which is available online at
347       http://dev.mysql.com/doc/index-utils-fabric.html
348

AUTHOR

350       Oracle Corporation (http://dev.mysql.com/).
351
352
353
354MySQL 1.5.6                       09/15/2015                   MYSQLRPLSHOW(1)
Impressum