r/w splitting error,only open a server,the open server is master.Thanks.anxious.anxious,Thanks!!!
Posted by:
cerlin gao
Date: September 06, 2007 03:34AM
Hello,I start mysql-proxy like this,
LUA_PATH="/usr/local/tools/mysql-proxy/trunk/lib/xtab.lua" /usr/local/sbin/mysql-proxy --proxy-backend-addresses=192.168.0.7:3306 --proxy-read-only-backend-addresses=192.168.0.6:3306 --proxy-lua-script=/usr/local/tools/mysql-proxy/trunk/lib/turial-keepalive.lua
I have different data sets on two servers,with the same database name,the same table name and structure, only the data differs.
192.168.0.7:
mysql> SELECT * from `Group`;
+----+----------+---------
| id | uid | name
+----+----------+----------
| 1 | 1 | aaaa |
|
+----+----------+----------
1 rows in set (0.00 sec)
192.168.0.6:
mysql> select * from `Group`;
+----+----------+----
| id | uid | name |
+----+----------+-------
| 1 1 nnnnnn
+----+----------+------
4 rows in set (0.00 sec)
then I connect mysql-proxy from 2 clients like this,
mysql -h 192.168.0.7 -P 4040
client #1:
mysql> SELECT * from `Group`;
+----+----------+---------
| id | uid | name
+----+----------+----------
| 1 | 1 | aaaa |
|
+----+----------+----------
1 rows in set (0.00 sec)
client #2:
mysql> SELECT * from `Group`;
+----+----------+---------
| id | uid | name
+----+----------+----------
| 1 | 1 | aaaa |
|
+----+----------+----------
1 rows in set (0.00 sec)
So it seems that the proxy won't connect each client to each server in a round-robin fashion. And is not connect read only server.
How to make it run in a r/w splitting. Or this lua script have error?Please send me a right script.Thanks
Subject
Views
Written By
Posted
r/w splitting error,only open a server,the open server is master.Thanks.anxious.anxious,Thanks!!!
3465
September 06, 2007 03:34AM
2254
September 06, 2007 04:12AM
2961
September 06, 2007 04:43AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.