mysql-proxy admin script with admin.lua and reporter.lua

Asked by Quang Nguyen

Hi, I'm trying to use 2 script : admin.lua and reporter.lua on http://dev.mysql.com/doc/refman/5.1/en/mysql-proxy-using-admin.html to tracking my backend server. But with those 2 script, I can just only run "SHOW PROXY PROCESSLIST" and "show querycounter", when I run "SELECT * FROM backends", it shows errors:

mysql> select * from backends;
ERROR 1105 (07000): error

I tried those 2 scripts on http://fmpwizard.blogspot.com/2009/04/how-do-i-use-mysql-proxy-admin-plugin.html too, but it's even worse (SHOW PROXY PROCESSLIST and querycounter return that error too).

My Proxy version is:
mysql-proxy 0.7.2
  glib2: 2.22.2
  libevent: 1.4.13-stable
  lua: Lua 5.1.4
    LUA_PATH: /usr/lib/mysql-proxy/lua/?.lua
    LUA_CPATH: /usr/lib/mysql-proxy/lua/?.so
  == plugins ==
  admin: 0.7.0
  proxy: 0.7.0

My OS version is Ubuntu 10.04

Please help me solve this problem. Thanks

Quang

Update: this is my log error when I run SELECT * FROM backends:
2011-01-23 23:58:51: (critical) (read_query) [string "/usr/share/mysql-proxy/admin.lua"]:155: bad argument #1 to 'pairs' (table expected, got nil)

Question information

Language:
English Edit question
Status:
Answered
For:
MySQL Proxy Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
fmpwizard (diego-fmpwizard) said :
#1

Hi,

How are you starting the mysql proxy?

Could you paste the command line you are using?

Thanks

Diego Medina
On Jan 24, 2011 4:07 AM, "Quang Nguyen" <
<email address hidden>> wrote:
> New question #142640 on MySQL Proxy:
> https://answers.launchpad.net/mysql-proxy/+question/142640
>
> Hi, I'm trying to use 2 script : admin.lua and reporter.lua on
http://dev.mysql.com/doc/refman/5.1/en/mysql-proxy-using-admin.html to
tracking my backend server. But with those 2 script, I can just only run
"SHOW PROXY PROCESSLIST" and "show querycounter", when I run "SELECT * FROM
backends", it shows errors:
>
> mysql> select * from backends;
> ERROR 1105 (07000): error
>
> I tried those 2 scripts on
http://fmpwizard.blogspot.com/2009/04/how-do-i-use-mysql-proxy-admin-plugin.htmltoo,
but it's even worse (SHOW PROXY PROCESSLIST and querycounter return
that error too).
>
> My Proxy version is:
> mysql-proxy 0.7.2
> glib2: 2.22.2
> libevent: 1.4.13-stable
> lua: Lua 5.1.4
> LUA_PATH: /usr/lib/mysql-proxy/lua/?.lua
> LUA_CPATH: /usr/lib/mysql-proxy/lua/?.so
> == plugins ==
> admin: 0.7.0
> proxy: 0.7.0
>
> My OS version is Ubuntu 10.04
>
> Please help me solve this problem. Thanks
>
> Quang
>
>
>
> --
> You received this question notification because you are a member of
> MySQL Proxy Discuss, which is an answer contact for MySQL Proxy.

Revision history for this message
Quang Nguyen (tinquang) said :
#2

I start my proxy using config file:
mysql-proxy --defaults-file=/etc/mysql-proxy.cnf
And here is my config file:

[mysql-proxy]
daemon = true
keepalive = true

pid-file=/var/run/mysql-proxy.pid
log-file=/var/log/mysql-proxy/mysql-proxy.log
log-level=debug
proxy-backend-addresses=192.168.2.3
proxy-backend-addresses=192.168.2.4
proxy-lua-script=/usr/share/mysql-proxy/reporter.lua
admin-username=root
admin-password=secret
admin-lua-script=/usr/share/mysql-proxy/admin.lua

I hope this information will help. Thanks for your quick answer.

Quang

Revision history for this message
fmpwizard (diego-fmpwizard) said :
#3

Hi,

The proxy-backend-addresses is missing the port number of your mysql severs

Diego Medina
On Jan 24, 2011 4:28 AM, "Quang Nguyen" <
<email address hidden>> wrote:
> Question #142640 on MySQL Proxy changed:
> https://answers.launchpad.net/mysql-proxy/+question/142640
>
> Status: Answered => Open
>
> Quang Nguyen is still having a problem:
> I start my proxy using config file:
> mysql-proxy --defaults-file=/etc/mysql-proxy.cnf
> And here is my config file:
>
> [mysql-proxy]
> daemon = true
> keepalive = true
>
> pid-file=/var/run/mysql-proxy.pid
> log-file=/var/log/mysql-proxy/mysql-proxy.log
> log-level=debug
> proxy-backend-addresses=192.168.2.3
> proxy-backend-addresses=192.168.2.4
> proxy-lua-script=/usr/share/mysql-proxy/reporter.lua
> admin-username=root
> admin-password=secret
> admin-lua-script=/usr/share/mysql-proxy/admin.lua
>
> I hope this information will help. Thanks for your quick answer.
>
> Quang
>
> --
> You received this question notification because you are a member of
> MySQL Proxy Discuss, which is an answer contact for MySQL Proxy.

Revision history for this message
Quang Nguyen (tinquang) said :
#4

Hi, I just added the port number but it still return error, my mysql servers use default port 3306,so I think this is not the reason.
Thanks.

Quang

Revision history for this message
fmpwizard (diego-fmpwizard) said :
#5

I'm not sure it will fix it but could you try version 0.8.1 ?

Diego Medina
On Jan 24, 2011 8:55 PM, "Quang Nguyen" <
<email address hidden>> wrote:
> Question #142640 on MySQL Proxy changed:
> https://answers.launchpad.net/mysql-proxy/+question/142640
>
> Status: Answered => Open
>
> Quang Nguyen is still having a problem:
> Hi, I just added the port number but it still return error, my mysql
servers use default port 3306,so I think this is not the reason.
> Thanks.
>
> Quang
>
> --
> You received this question notification because you are a member of
> MySQL Proxy Discuss, which is an answer contact for MySQL Proxy.

Revision history for this message
Quang Nguyen (tinquang) said :
#6

mysql-proxy that I'm using, I installed it by running apt-get install on ubuntu, and the current version of mysql-proxy for ubuntu 10.04 is 0.7.2. If I want to try 0.8.1, I will have to build it from source, but I think I have to try, I will let you know if this version can solve my problem.
Thanks.

Quang

Revision history for this message
fmpwizard (diego-fmpwizard) said :
#7

You can download it from the mysql site

Diego Medina
On Jan 24, 2011 10:01 PM, "Quang Nguyen" <
<email address hidden>> wrote:
> Question #142640 on MySQL Proxy changed:
> https://answers.launchpad.net/mysql-proxy/+question/142640
>
> Status: Answered => Open
>
> Quang Nguyen is still having a problem:
> mysql-proxy that I'm using, I installed it by running apt-get install on
ubuntu, and the current version of mysql-proxy for ubuntu 10.04 is 0.7.2. If
I want to try 0.8.1, I will have to build it from source, but I think I have
to try, I will let you know if this version can solve my problem.
> Thanks.
>
> Quang
>
> --
> You received this question notification because you are a member of
> MySQL Proxy Discuss, which is an answer contact for MySQL Proxy.

Can you help with this problem?

Provide an answer of your own, or ask Quang Nguyen for more information if necessary.

To post a message you must log in.