简体   繁体   English

xtrabackup 不会在 xtrabackup_binlog_info 中写入 gtid 信息

[英]xtrabackup does not write gtid information in xtrabackup_binlog_info

Software versions:软件版本:

xtrabackup 8.0.12
percona-xtradb-cluster-server 8.0.18-9

I am running xtrabackup with this options:我正在使用以下选项运行 xtrabackup:

--defaults-file=/etc/mysql/my.cnf --backup --user=backup
--password=**** --parallel=4 --no-timestamp --target-dir=/my-backup-dir

Some of server options:一些服务器选项:

binlog_format | ROW
gtid_mode     | ON_PERMISSIVE
enforce_gtid_consistency | ON

File xtrabackup_binlog_info has only binlog file name and position:文件xtrabackup_binlog_info只有 binlog 文件名和 position:

mysql-bin.000159        251

No GTID, so I can not create GTID-based replication restoring a slave from this backup.没有 GTID,因此我无法创建基于 GTID 的复制,从该备份恢复从属。

What should I do to make xtrabackup include this information?我应该怎么做才能使 xtrabackup 包含此信息?

UPDATE :更新

Check if GTIDs are enabled:检查是否启用了 GTID:

show global variables like '%gtid%';

| Variable_name                    | Value                                                                                                           |
| binlog_gtid_simple_recovery      | ON                                                                                                              |
| enforce_gtid_consistency         | ON                                                                                                              |
| gtid_executed                    | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3399594,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |
| gtid_executed_compression_period | 1000                                                                                                            |
| gtid_mode                        | ON_PERMISSIVE                                                                                                   |
| gtid_owned                       |                                                                                                                 |
| gtid_purged                      | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-2661056,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |
| session_track_gtids              | OFF                                                                                                             |
show master status;

| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                                                                                               |
| mysql-bin.000166 | 15285372 |              |                  | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3358798,
de211648-2642-ee18-628d-dc48283b005c:1-3697598:3877279-10141440 |

(pavel.selivanov@localhost) [kassa_prod]> show binlog events in 'mysql-bin.000166' limit 7;

| Log_name         | Pos  | Event_type     | Server_id | End_log_pos | Info
| mysql-bin.000166 |    4 | Format_desc    |      4315 |         124 | Server ver: 8.0.18-9, Binlog ver: 4                                                                           |
| mysql-bin.000166 |  124 | Previous_gtids |      4315 |         251 | c0e3de06-a2a6-11ea-913c-c7b046cf5782:1-3347159,
de211648-2642-ee18-628d-dc48283b005c:3697598:3877279-10141440 |
| mysql-bin.000166 |  251 | Gtid           |      4315 |         330 | SET @@SESSION.GTID_NEXT= 'c0e3de06-a2a6-11ea-913c-c7b046cf5782:3347160'                                       |
| mysql-bin.000166 |  330 | Query          |      4315 |         411 | BEGIN                                                                                                         |
| mysql-bin.000166 |  411 | Table_map      |      4315 |         499 | table_id: 150 (db.table)                                                                      |
| mysql-bin.000166 |  499 | Update_rows    |      4315 |        3475 | table_id: 150 flags: STMT_END_F                                                                               |
| mysql-bin.000166 | 3475 | Xid            |      4315 |        3506 | COMMIT /* xid=9611331 */                                                          

From the manual :手册

  • ON_PERMISSIVE: New transactions are GTID transactions. ON_PERMISSIVE:新交易是 GTID 交易。 Replicated transactions can be either anonymous or GTID transactions.复制的交易可以是匿名交易或 GTID 交易。

Check with show global variables like 'gt%';检查show global variables like 'gt%'; or in your binary logs, if you actually have GTID transactions.或者在您的二进制日志中,如果您确实有 GTID 事务。

You actually don't have anything special to do, to have xtrabackup include GTIDs in the xtrabackup_binlog_info file: How to create a new (or repair a broken) GTID based slave您实际上没有什么特别的事情要做,让 xtrabackup 在 xtrabackup_binlog_info 文件中包含 GTID: 如何创建新的(或修复损坏的)基于 GTID 的从站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM