~ubuntu-branches/debian/jessie/mysql-utilities/jessie

« back to all changes in this revision

Viewing changes to doc/man/mysqlfailover.rst

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2013-05-14 15:02:12 UTC
  • mfrom: (4.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130514150212-cfj83guqqo0kx7l0
Tags: 1.1.2-1
* Upload to unstable.
* "X-Python-Version: >= 2.7" to stop using deprecated python-2.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
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.
29
29
 
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.
131
131
 
132
132
**gtid**
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
screen.
135
138
 
136
139
**UUID**
137
140
Display universally unique identifiers (UUIDs) for all servers.
171
174
 
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.
175
178
 
176
179
.. option:: --discover-slaves-login=<user:password>
177
180
 
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
242
245
   return.
 
246
   
 
247
.. option:: --rpl-user=<user>[:<password>]
 
248
 
 
249
   The user and password for the replication user requirement - e.g. rpl:passwd
 
250
   Default = None.
243
251
 
244
252
.. option:: --seconds-behind=<seconds>
245
253
 
250
258
 
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
 
263
   slave of the master.
254
264
 
255
265
.. option:: --timeout=<seconds>
256
266
 
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.
285
295
 
 
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.
 
302
 
 
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
 
308
machine. 
 
309
 
 
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.
 
314
 
 
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 
 
317
an error.
286
318
 
287
319
EXAMPLES
288
320
--------
297
329
An example of the user interface and some of the report views are shown in the
298
330
following examples.
299
331
 
 
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.
 
336
 
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
302
339
shown below::
303
340
 
304
 
  $ mysqlfailover --master=root@localhost:3331 --discover-slaves-login=root
 
341
  $ mysqlfailover --master=root@localhost:3331 --discover-slaves-login=root \
 
342
    --log=log.txt
305
343
 
306
344
  MySQL Replication Monitor and Failover Utility
307
345
  Failover Mode = auto     Next Interval = Mon Mar 19 15:56:03 2012
309
347
  Master Information
310
348
  ------------------
311
349
  Binary Log File   Position  Binlog_Do_DB  Binlog_Ignore_DB  
312
 
  mysql-bin.000001  571                                       
 
350
  mysql-bin.000001  571
 
351
  
 
352
  GTID Executed Set
 
353
  2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
313
354
  
314
355
  Replication Health Status
315
356
  +------------+-------+---------+--------+------------+---------+
326
367
the current display. Pressing the 'h' key will return to the replication health
327
368
report.
328
369
 
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. ::
330
372
 
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                                       
338
380
  
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
 
  +------------+-------+---------+-------------------------------------------+
 
381
  GTID Executed Set
 
382
  2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
 
383
  
 
384
  Master GTID Executed Set
 
385
  +-------------------------------------------+
 
386
  | gtid                                      |
 
387
  +-------------------------------------------+
 
388
  | 2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7  |
 
389
  | 5503D37E-2DB2-11E2-A781-8077D4C14B33:1-3  |
 
390
  +-------------------------------------------+
 
391
 
 
392
 
348
393
  Q-quit R-refresh H-health G-GTID Lists U-UUIDs L-log entries Up|Down-scroll
349
394
 
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                                       
367
412
  
 
413
  GTID Executed Set
 
414
  2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
 
415
  
368
416
  UUIDs
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                                      
410
458
  
 
459
  GTID Executed Set
 
460
  2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
 
461
  
411
462
  UUIDs
412
463
  +------------+-------+---------+--------+------------+---------+
413
464
  | host       | port  | role    | state  | gtid_mode  | health  |
431
482
  Binary Log File   Position  Binlog_Do_DB  Binlog_Ignore_DB  
432
483
  mysql-bin.000001  1117                                      
433
484
  
 
485
  GTID Executed Set
 
486
  2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
 
487
  
434
488
  Log File
435
489
  +-------------------------+----------------------------------------- ... --+
436
490
  | Date                    | Entry                                    ...   |