I have the following configuration:
1 master (192.168.82.161) and 1 slave (192.168.82.162). And mysql-proxy running on another
I've started mysql-proxy with the following configuration:
mysql-proxy --admin-username=root --admin-password=root
192.168.82.161:3306 --proxy-backend-addresses 192.168.82.162:3306
The Lua script (first_example.lua) consists on this:
if string.byte(packet) == proxy.COM_BINLOG_DUMP then
print("Received the packet COM_BINLOG_DUMP")
if string.byte(packet) == proxy.COM_QUERY then
print("Received the query: " .. string.sub(packet, 2))
if string.byte(packet) == proxy.COM_CREATE_DB then
print("Received the create database statement: " .. string.sub(packet, 2))
I start the mysql-proxy, and the master and slave. In the slave I use this configuration:
CHANGE MASTER TO MASTER_HOST='192.168.82.163', MASTER_USER='repl',
MASTER_PASSWORD='repl', MASTER_LOG_FILE='mysqld-bin.000001', MASTER_LOG_POS=0,
After that I start the slave, and everything goes OK. I receive on the mysql-proxy the
Received the query: SELECT UNIX_TIMESTAMP()
Received the query: SHOW VARIABLES LIKE 'SERVER_ID'
Received the packet COM_BINLOG_DUMP
But when I execute some statement on the master like create database x, or some SQL query
I don't receive anything on the mysql-proxy. It was supposed to do the prints that I've
write on the lua script.
So, can someone help me with this? Maybe I am misunderstanding mysql-proxy functioning.
Thanks in advance,
On May 25, 2010, at 4:28 PM, Mats Kindahl wrote:
> On 05/25/2010 05:24 PM, Miguel Araújo wrote:
>> Does anyone knows how mysq-proxy interacts with replication?
>> I've never used mysql-proxy, and I need an application that stand between the
> master and the slave to analyze the updates that go through the master to the slave. I
> wonder if I should start with mysq-proxy instead of starting from the scratch.
>> Thank you.
>> Miguel Araújo
> Hi again Miguel! :)
> Yes, I think it is a good idea to start with the proxy instead of
> starting from scratch.
> What is it you want to do?
> Best wishes,
> Mats Kindahl
> Mats Kindahl
> Lead Software Developer
> MySQL Replication, Oracle
> MySQL Replication Mailing List
> For list archives: http://lists.mysql.com/replication
> To unsubscribe: http://lists.mysql.com/replication?unsub=1