25
25
This utility is designed to work exclusively for servers that support global
26
26
transaction identifiers (GTIDs) and have GTID_MODE=ON. MySQL server versions
27
5.6.5 and higher support GTIDs. See the MySQL server online reference manual
27
5.6.9 and higher support GTIDs. See the MySQL server online reference manual
28
28
for more information about setting up replication with GTIDs enabled.
30
30
The user can specify the interval in seconds to use for detecting the master
130
130
new slaves are discovered, the health report is refreshed.
133
Display the contents of the GTID variables, @@GLOBAL.GTID_DONE,
134
@@GLOBAL.GTID_LOST, and @@GLOBAL.GTID_OWNED.
133
Display the master's list of executed GTIDs, contents of the GTID variables;
134
@@GLOBAL.GTID_EXECUTED, @@GLOBAL.GTID_PURGED, and @@GLOBAL.GTID_OWNED. Thus,
135
the user can toggle through four screens by pressing the 'G' key repeatedly.
136
The display will cycle through all four screens restarting after the fourth
137
140
Display universally unique identifiers (UUIDs) for all servers.
172
175
Connection information for candidate slave servers for failover in the form:
173
176
<*user*>[:<*passwd*>]@<*host*>[:<*port*>][:<*socket*>]. Valid only with
174
failover command. List multiple slaves in comma- separated list.
177
failover command. List multiple slaves in comma-separated list.
176
179
.. option:: --discover-slaves-login=<user:password>
240
243
Number of ping attempts for detecting downed server. Note: on some
241
244
platforms this is the same as number of seconds to wait for ping to
247
.. option:: --rpl-user=<user>[:<password>]
249
The user and password for the replication user requirement - e.g. rpl:passwd
244
252
.. option:: --seconds-behind=<seconds>
251
259
Connection information for slave servers in the form:
252
260
<*user*>[:<*passwd*>]@<*host*>[:<*port*>][:<*socket*>]. List multiple slaves
253
in comma-separated list.
261
in comma-separated list. The list will be evaluated literally whereby each
262
server is considered a slave to the master listed regardless if they are a
255
265
.. option:: --timeout=<seconds>
283
293
deregisters itself from the master. If this process is broken, the user may
284
294
override the registration check by using the :option:`--force` option.
296
Mixing IP and hostnames is not recommended. The replication-specific utilities
297
will attempt to compare hostnames and IP addresses as aliases for checking
298
slave connectivity to the master. However, if your installation does not
299
support reverse name lookup, the comparison could fail. Without the ability to
300
do a reverse name lookup, the replication utilities could report a false
301
negative that the slave is (not) connected to the master.
303
For example, if you setup replication using MASTER_HOST=ubuntu.net on the
304
slave and later connect to the slave with mysqlrplcheck and have the master
305
specified as --master=192.168.0.6 using the valid IP address for ubuntu.net,
306
you must have the ability to do a reverse name lookup to compare the IP
307
(192.168.0.6) and the hostname (ubuntu.net) to determine if they are the same
310
Similarly, in order to avoid issues mixing local IP '127.0.0.1' with
311
'localhost', all the addresses '127.0.0.1' will be internally converted to
312
'localhost' by the utility. Nevertheless, It is best to use the actual hostname
313
of the master when connecting or setting up replication.
315
The utility will check to see if the slaves are using the option
316
--master-info-repository=TABLE. If they are not, the utility will stop with
297
329
An example of the user interface and some of the report views are shown in the
298
330
following examples.
332
Note: The GTID Executed Set will display the first GTID listed in the SHOW
333
MASTER STATUS view. If there are multiple GTIDs listed, the utility shall
334
display [...] to indicate there are additional GTIDs to view. You can view
335
the complete list of GTIDs on the GTID display screens.
300
337
The default interface will display the replication health report like the
301
338
following. In this example the log file is enabled. A sample startup command is
304
$ mysqlfailover --master=root@localhost:3331 --discover-slaves-login=root
341
$ mysqlfailover --master=root@localhost:3331 --discover-slaves-login=root \
306
344
MySQL Replication Monitor and Failover Utility
307
345
Failover Mode = auto Next Interval = Mon Mar 19 15:56:03 2012
326
367
the current display. Pressing the 'h' key will return to the replication health
329
If the user presses the 'g' key, the gtid report is shown like the following.::
370
If the user presses the 'g' key, the gtid report is shown like the following.
371
The first page shown is the master's executed GTID set. ::
331
373
MySQL Replication Monitor and Failover Utility
332
374
Failover Mode = auto Next Interval = Mon Mar 19 15:59:33 2012
336
378
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
337
379
mysql-bin.000001 571
339
Transactions executed on the server
340
+------------+-------+---------+-------------------------------------------+
341
| host | port | role | uuid |
342
+------------+-------+---------+-------------------------------------------+
343
| localhost | 3331 | MASTER | 55C65A00-71FD-11E1-9F80-AC64EF85C961:1-2 |
344
| localhost | 3332 | SLAVE | 55C65A00-71FD-11E1-9F80-AC64EF85C961:1-2 |
345
| localhost | 3332 | SLAVE | 5DD30888-71FD-11E1-9F80-DC242138B7EC:1 |
346
| localhost | 3333 | SLAVE | 55C65A00-71FD-11E1-9F80-AC64EF85C961:1-2 |
347
+------------+-------+---------+-------------------------------------------+
382
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
384
Master GTID Executed Set
385
+-------------------------------------------+
387
+-------------------------------------------+
388
| 2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 |
389
| 5503D37E-2DB2-11E2-A781-8077D4C14B33:1-3 |
390
+-------------------------------------------+
348
393
Q-quit R-refresh H-health G-GTID Lists U-UUIDs L-log entries Up|Down-scroll
350
395
If the user continues to press the 'g' key, the display will cycle through the
365
410
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
366
411
mysql-bin.000001 571
414
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
369
417
+------------+-------+---------+---------------------------------------+
370
418
| host | port | role | uuid |
408
456
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
409
457
mysql-bin.000001 1117
460
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
412
463
+------------+-------+---------+--------+------------+---------+
413
464
| host | port | role | state | gtid_mode | health |