Ошибка Debezium - невозможно выполнить репликацию, поскольку мастер очистил необходимые двоичные журналы

Я использую debezium-kafka для фиксации изменений в MySQL. Для MySQL я использую AWS RDS. У меня конфигурация чтения-реплики с включенным GTID. Я подключил дебезиум к реплике.

Но после нескольких дней работы debezium завершился ошибкой:

org.apache.kafka.connect.errors.ConnectException: Cannot replicate because the master purged required binary logs. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. To find the missing transactions, see the master's error log or the manual for GTID_SUBTRACT. Error code: 1236; SQLSTATE: HY000.
tat io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
tat io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:197)
tat io.debezium.connector.mysql.BinlogReader$ReaderThreadLifecycleListener.onCommunicationFailure(BinlogReader.java:1018)
tat com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:950)
tat com.github.shyiko.mysql.binlog.BinaryLogClient.connect(BinaryLogClient.java:580)
tat com.github.shyiko.mysql.binlog.BinaryLogClient$7.run(BinaryLogClient.java:825)
tat java.base/java.lang.Thread.run(Thread.java:834)
aused by: com.github.shyiko.mysql.binlog.network.ServerException: Cannot replicate because the master purged required binary logs. Replicate the missing transactions from elsewhere, or provision a new slave from backup. Consider increasing the master's binary log expiration period. To find the missing transactions, see the master's error log or the manual for GTID_SUBTRACT.
tat com.github.shyiko.mysql.binlog.BinaryLogClient.listenForEventPackets(BinaryLogClient.java:914)
t... 3 more

Я не могу понять, что вызывает проблему, и мастер и реплика MYSQL исправны, оба работают и работают. Тогда почему дебезиум не удалось?


person Rajat Goel    schedule 28.06.2019    source источник


Ответы (1)


Хорошо, я нашел решение, я использую Amazon RDS MySQL. Обычно Amazon RDS очищает двоичный журнал при первой возможности. Из-за чего GTID очищался до того, как был поглощен Дебезиумом.

Чтобы указать количество часов, в течение которых RDS будет хранить двоичный файл:

call mysql.rds_set_configuration('binlog retention hours', 24);

Ссылка: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.MySQL.html

person Rajat Goel    schedule 07.07.2019