Squake
Squake

Reputation: 427

Cannot read the binlog filename and position via 'SHOW MASTER STATUS'

I am making some POC using debezium version 0.9 and I am running a standalon docker-ized mysql database using the embedded Debezium configuration. I am running into this issue:

Caused by: java.lang.IllegalStateException: Cannot read the binlog filename and position via 'SHOW MASTER STATUS'. Make sure your server is correctly configured

I suspect it's because the standalone configuration of mysql or the embedded configuration, but not sure how to proceed and fix. Any hint?

Upvotes: 5

Views: 7904

Answers (2)

Angad Singh Rajput
Angad Singh Rajput

Reputation: 19

This normally happens when the binlogs are turned off.

The solution is to enable the log_bin property of MySQL.

Upvotes: -1

runwuf
runwuf

Reputation: 1717

As Bill pointed out in the above comment - Debezium connector uses binary log to do its job so it needs to be enabled.

Debezium MySQL requires enabling the server binlog. In the case of RDS MySQL, the log_bin property is managed directly by AWS and is set to OFF by default. When Debezium MySQL executes the SHOW MASTER STATUS command during a snapshot, the result set is empty and an exception is thrown:

https://debezium.io/documentation/faq/

You can check if binlog is enabled with show master status and that is the error you are getting from debezium when it's disabled. The following is an example when binlog is enabled, when it's disabled there would be no rows returned.

mysql> show master status;
+------------------+----------+--------------+------------------+--------------------------------------------+
| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set                          |
+------------------+----------+--------------+------------------+--------------------------------------------+
| mysql-bin.000001 |   170796 |              |                  | bf9ae151-baac-11ec-919f-42010a8a0014:1-599 |
+------------------+----------+--------------+------------------+--------------------------------------------+

For Google Cloud SQL MySQL 5.x you need to enable point-in-time recovery https://cloud.google.com/sql/docs/mysql/backup-recovery/pitr#enablingpitr

Upvotes: 2

Related Questions