List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:March 20 2011 4:13pm
Subject:Re: about change of slave
View as plain text  
Hi, Haihao!

On Mar 03, Haihao Tang wrote:
> Hi,
>   In Master-Slave environment, I want to make the slave be a
> intermediate transit point. The slave pulls relay-log from binlog of
> the master, and then not only redo relay-log but also send the data
> (insert, update and etc data from master) to defined module. I have
> three bule print about it:
> 1. Create a new UDF. With the help of trigger, when slave insert,
> update and delete rows, the trigger will call UDF to send the data;
> 2. Modify the SQL thread of slave. SQL thread send the data, instead
> of redoing the SQL statment;
> 3. Add some code into specified storage engine to obtain the data and send it.
> I think the first is the best, since it can be a plugin.
> Do you have any suggestions?

In what format do you want your "data"?
If you need sql statements, than the simplest solution would be to log
everything the slave is fetching from the master. Either by enabling
general log on the slave, or by putting mysql proxy between the master
and a slave. Or with tcpdump, for example.

about change of slaveHaihao Tang3 Mar
  • Re: about change of slaveSergei Golubchik20 Mar