I didn't know how to describe it so I am calling it semi circle. Here's what I am doing.
Server A
Server B = This is slave of Server A
Server C = This is slave of Server B
When I update something on Server A then it is reflected on Server B. But the same change is not reflected on Server C.
Only when I update something on Server B then change is reflected on Server C.
How do I make it so any changes done on Server A will come to Server B (which is already working) and then it goes to Server C?
EDIT
Upon investigation I found out that when I make some change on Server A then its log file position changes. But when those changes are reflected on Server B then Server B log file position doesn't change. It is because of this reason Server C doesn't know if there has been any change on Server B unless I explicitly change something (insert,update,delete) on Server B.
So is there a way to tell MySQL to increment log file position when Slave is receiving updates from Master?
Best Answer
I think the problem is the following:
Since B is a Slave of A, replication log position changes when something on A is executed and then records the changes to its binlogs. Server B picks up Server A binlog events and executes it.
Why won't Server B just pass it on to Server C ?
Server B need the following option enabled
Whenever you want a server to be a Slave and a Master at the same time, you need log_slave_updates enabled. Here is what the MySQL Documentation says:
In your case, Server B reads Server A's binlog events as recorded in Server B's relay logs, executes those events in Server B and nothing more.
When you enable log_slave_updates on Server B, then the following happens
I mentioned using log_slave_updates a couple of times before:
Sep 09, 2014
: Is it mandatory to enable --log_slave_updates with MySQL Replication using GTID?Nov 26, 2012
: Replicate MySQL 5.0 Master to 5.5 Slave?Therefore, when you said
The
explicitly change something
becomes implicit when you use log_slave_updates.