MySQL Forums
Forum List  »  Router & Proxy

mysql-proxy (error:08S01/1047)
Posted by: wei biao
Date: July 31, 2012 05:52AM

mysql-proxy (about:08S01/1047)

1.topology:

mysql-proxy (10.1.1.1)
mysql-master (10.1.1.2-Only-write)
mysql-slave (10.1.1.3-Only-read)

2.Environment:
RHEL-5.5-64
MySQL-5.5.20
MySQL-Proxy-0.8.2

3.Config:
MySQL-Proxy:
vim /usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua
min_idle_connections = 1,
max_idle_connections = 1,
vim /usr/local/bin/mysql-proxy
/usr/local/mysql-proxy/bin/mysql-proxy
--proxy-address=10.1.1.1:4040
--proxy-read-only-backend-addresses=10.1.1.3:3306
--proxy-backend-addresses=10.1.1.2:3306
--proxy-lua-script=/usr/local/mysql-proxy/share/doc/mysql-proxy/rw-splitting.lua
--log-level=debug
--log-file=/var/log/mysql-proxy.log
--daemon

Master:
create database db1;
Use db1
Create table t1(id int);
Insert into t1 vaslues(1111);
Grant all on db1.* to testing@"%" identified by "testing~!@#$%^&*"

Slave:
create database db1;
Use db1
Create table t1(id int);
Insert into t1 values(2222);
Grant all on db1.* to testing@"%" identified by "testing~!@#$%^&*"


4.Verify:(client login test)

First time:
mysql -utesting -h 10.1.1.1 -P4000 -p
mysql>select * from db1.t1;
+------+
| id |
+------+
|1111 |
+------+
3 rows in set (0.02 sec)

mysql>show processlist;
+-------+---------+----------------------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+---------+----------------------+------+---------+------+-------+------------------+
| 22030 | testing | 10.1.1.1:46536 | NULL | Query | 0 | NULL | show processlist |
+-------+---------+----------------------+------+---------+------+-------+------------------+
1 row in set (0.02 sec)


Secondary time:
mysql -utesting -h 10.1.1.1 -P4000 -p
mysql>select * from db1.t1;
+------+
| id |
+------+
|1111 |
+------+
3 rows in set (0.02 sec)

mysql> show processlist;
+-------+---------+----------------------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+---------+----------------------+------+---------+------+-------+------------------+
| 22030 | testing | 10.1.1.1:46536 | NULL | Query | 0 | NULL | show processlist |
| 22636 | testing | 10.1.1.1:60080 | NULL | Sleep | 3 | | NULL |
+-------+---------+----------------------+------+---------+------+-------+------------------+
2 rows in set (0.02 sec)


third time:
mysql -utesting -h 10.1.1.1 -P4000 -p
mysql>select * from db1.t1;
+------+
| id |
+------+
|2222 |
+------+
3 rows in set (0.02 sec)

mysql> show processlist;
+-------+---------+----------------------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+---------+----------------------+------+---------+------+-------+------------------+
| 22030 | testing | 10.1.1.1:46536 | NULL | Query | 0 | NULL | show processlist |
| 22636 | testing | 10.1.1.1:60080 | NULL | Sleep | 3 | | NULL |
+-------+---------+----------------------+------+---------+------+-------+------------------+
2 rows in set (0.02 sec)

ssh 10.1.1.3
mysql>show processlist;

| 6 | testing | 10.1.1.1:54607 | NULL | Sleep | 44 |


four time:
mysql -utesting -h 10.1.1.1 -P4000 -p
mysql>select * from db1.t1;
+------+
| id |
+------+
|2222 |
+------+
3 rows in set (0.02 sec)

mysql> show processlist;
+-------+---------+----------------------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+---------+----------------------+------+---------+------+-------+------------------+
| 22030 | testing | 10.1.1.1:46536 | NULL | Query | 0 | NULL | show processlist |
| 22636 | testing | 10.1.1.1:60080 | NULL | Sleep | 3 | | NULL |
+-------+---------+----------------------+------+---------+------+-------+------------------+
2 rows in set (0.02 sec)


ssh 10.1.1.3
mysql>show processlist;

| 6 | testing | 10.1.1.1:54607 | NULL | Sleep | 44 |
| 8 | testing | 10.1.1.1:57976 | NULL | Sleep | 32 |


five time:
tell me error:
ERROR 1047 (08S01): Unknown command

4.Question:
1>proxy must be a options about set max_connections.
2>when proxy login master/slave ,i quite proxy,
but proxy don't quit master/slave automatically.

5.about log messages:

2012-07-31 19:20:38: (message) mysql-proxy 0.8.2 started
2012-07-31 19:20:38: (debug) max open file-descriptors = 102400
2012-07-31 19:20:38: (message) proxy listening on port 10.1.1.1:4000
2012-07-31 19:20:38: (message) added read/write backend: 10.1.1.2:3306
2012-07-31 19:20:38: (message) added read-only backend: 10.1.1.3:3306
2012-07-31 19:21:58: (debug) [network-mysqld.c:937]: error on a connection (fd: -1 event: 0). closing client connection.



Edited 2 time(s). Last edit at 08/01/2012 01:09AM by wei biao.

Options: ReplyQuote


Subject
Views
Written By
Posted
mysql-proxy (error:08S01/1047)
6495
July 31, 2012 05:52AM


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.