简体   繁体   English

如何在 mysql 5.7 中完全禁用 GTID?

[英]How to completely disable GTID in mysql 5.7?

As my mysql database is just used with a small web app, I won't ever need any replication features.由于我的 mysql 数据库仅用于一个小型 Web 应用程序,因此我永远不需要任何复制功能。 While monitoring, I noticed something named thread/sql/compress_gtid_table .在监控时,我注意到一个名为thread/sql/compress_gtid_table东西。 And while dumping some tables with mysqldump I got this warning:在用mysqldump转储一些表时,我收到了这个警告:

Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

How can I be sure, all GTID features are completely disabled and are not causing overhead ?我如何确定,所有 GTID 功能都已完全禁用并且不会造成开销?

Here is my config:这是我的配置:

mysql> SHOW VARIABLES LIKE '%GTID%';
+----------------------------------+----------------+
| Variable_name                    | Value          |
+----------------------------------+----------------+
| binlog_gtid_simple_recovery      | ON             |
| enforce_gtid_consistency         | OFF            |
| gtid_executed_compression_period | 1000           |
| gtid_mode                        | OFF            |
| gtid_next                        | AUTOMATIC      |
| gtid_owned                       |                |
| gtid_purged                      |                |
| session_track_gtids              | OFF            |
+----------------------------------+----------------+

I was just linked here while searching for that Warning.我只是在搜索该警告时被链接到这里。 I am setting up GTIDs but this page may be helpful for you: https://dev.mysql.com/doc/refman/5.7/en/replication-gtids-howto.html我正在设置 GTID,但此页面可能对您有所帮助: https ://dev.mysql.com/doc/refman/5.7/en/replication-gtids-howto.html

Note there is a warning that once you turn on GTID you cannot easily go backwards.请注意,有一个警告,即一旦您打开 GTID,您就无法轻易倒退。 I'm sure there is a way but it may not be worth the trouble.我确信有一种方法,但它可能不值得麻烦。

After you disable GTID replication and you don't need more your old binary logs (with GTID info) and slave has catch up all binlog info you can stop slave and do reset master;在您禁用 GTID 复制并且您不需要更多旧的二进制日志(带有 GTID 信息)并且从站已赶上所有二进制日志信息后,您可以停止从站并reset master; It will wipe out all binlogs from the server and no more gtid information will be kept.它将清除服务器中的所有二进制日志,并且不再保留 gtid 信息。 Refer to this post how to resync replication properly.请参阅这篇文章如何正确重新同步复制。

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

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