How to Fetch Data from the Upstream Database Slave in DM

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: dm 上游数据库如何从从库取

| username: TIDB_入门学者

Upstream database: MySQL
Upstream database slave mode: binlog, one master multiple slaves

The following implementation is feasible:
The downstream master synchronizes data from the upstream slave. Is this mode feasible? How to configure it?
My DM task configuration file for creating the data source is as follows:

Solved, the slave needs to enable the log_slave_updates parameter.

| username: Hacker007 | Original post link

The configuration is the same whether it’s from the replica or the primary database; just bind to different data sources. Binding to the replica will cause greater data latency and may lead to data consistency issues.

| username: wisdom | Original post link

Just configure it as if it were the primary database, paying attention to latency issues.

| username: TIDB_入门学者 | Original post link

However, the binlog of the replica is not increasing, how to retrieve it?

| username: TIDB_入门学者 | Original post link

But the binlog of the replica has not been increasing, how to retrieve it?

| username: TIDB_入门学者 | Original post link

However, the binlog of the replica has not been increasing.

| username: Hacker007 | Original post link

Generally, if binlog is enabled, it will increment normally. If there is an issue, then you need to check for problems with MySQL.

| username: TIDB_入门学者 | Original post link

  1. First of all, my upstream database has one master and multiple slaves;
  2. The slave database has only enabled binlog;
  3. The task of the slave database is only to synchronize the data of the master database;
  4. I checked the binlog logs, and there were no updates.
| username: buchuitoudegou | Original post link

  1. I checked the binlog logs, and there were no updates at all.

Is it that the slave did not write the synchronized data from the master to the local binlog? Have you set the log_slave_updates variable? Only by setting this variable will the slave write the synchronized changes to its own binlog.

FYI: https://dev.mysql.com/doc/refman/5.7/en/replication-options-binary-log.html#sysvar_log_slave_updates

As for DM, it does not care whether the database it is synchronizing is a slave or not; as long as there is a binlog, it can perform synchronization.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.