MySQL Forums
Forum List  »  Router & Proxy

Unable to get Lua Scripts to work (MySQL Proxy 0.8.1-win32-x86)
Posted by: Fred Fred
Date: October 18, 2010 10:39AM

Hi,

i am testing MySQL Proxy to learn more about this application. I am able to connect to MySQL Proxy on my computer when i donĀ“t refer to any Lua script in the configuration file but get a error when i try to use a Lua script in the configuration file.

I have downloaded and unzipped "mysql-proxy-0.8.1-win32-x86" from Mysql.com on my Windows Vista Computer, created a configuration file, installed MySQL Proxy as a Windows Service and created a test site with a connection string to MySQL Proxy that can do inserts and selects. I want to have read/write splitting so that inserts goes to one MySQL Server instance and selects goes to two MySQL Server instances.

I get this error message:
MySQL Proxy Lua script failed to execute. Check the error log.

The error log states:
2010-10-18 18:22:21: (message) mysql-proxy 0.8.1 started
2010-10-18 18:22:21: (message) proxy listening on port 127.0.0.1:4040
2010-10-18 18:22:21: (message) added read/write backend: 127.0.0.1:3307
2010-10-18 18:22:21: (message) added read-only backend: 127.0.0.1:3308
2010-10-18 18:22:21: (message) added read-only backend: 127.0.0.1:3309
2010-10-18 18:22:33: (critical) (lua-error) [D:/mysql-proxy-0.8.1-win32-x86/share/doc/mysql-proxy/rw-splitting.lua]
[string "D:/mysql-proxy-0.8.1-win32-x86/share/doc/my..."]:30: module 'proxy.commands' not found:
no field package.preload['proxy.commands']
no file 'D:/mysql-proxy-0.8.1-win32-x86/lib'
no file 'D:/mysql-proxy-0.8.1-win32-x86/bin/lua-proxy\commands.dll'
no file 'D:/mysql-proxy-0.8.1-win32-x86/bin/lua-proxy.dll'

My Configuration file (MySQL-Proxy-config.ini) looks like this:
# Options must be specified within a [mysql-proxy] configuration group
# ----------------------------------------------------------------------
[mysql-proxy]

# The base directory to use as a prefix for all other file name
# configuration options. The base name should be an absolute
# (not relative) directory.
# ----------------------------------------------------------------------
basedir=D:/mysql-proxy-0.8.1-win32-x86/

# IP-address, username and password for the administraton module
# ----------------------------------------------------------------------
admin-address=127.0.0.1:4041
admin-username=administrator
admin-password=*****
admin-lua-script=D:/mysql-proxy-0.8.1-win32-x86/lib/mysql-proxy/lua/admin.lua

# Starts the proxy in daemon mode.
# ----------------------------------------------------------------------
deamon=true

# The file to use to record log information. If this option is not given,
# mysql-proxy logs to the standard error output.
# ----------------------------------------------------------------------
log-file=mysql-proxy.log

# Valid values for log-level is error, warning, info, message and debug.
# message also outputs message with info, warning, and error levels.
# ----------------------------------------------------------------------
log-level=message

# The listening host name (or IP address) and port of the proxy server.
# The default is :4040 (all IPs on port 4040).
# ----------------------------------------------------------------------
proxy-address=127.0.0.1:4040

# The host name (or IP address) and port of the MySQL server to connect to.
# You can specify multiple backend servers by supplying multiple options.
# Clients are connected to each backend server in round-robin fashion.
# The IP-address of 127.0.0.1 is the localhost address and 3307 is the
# port for the master server that should be used for inserts and updates.
# ----------------------------------------------------------------------
proxy-backend-addresses=127.0.0.1:3307

# The listening host name (or IP address) and port of the proxy server
# for read-only connections. The IP-address of 127.0.0.1 is the localhost
# address, 3308 is the port for the first slave server that should be
# used for selects (reading) and 3309 is the port for the second slave
# server that should be used for selects (reading)..
# ----------------------------------------------------------------------
proxy-read-only-backend-addresses=127.0.0.1:3308, 127.0.0.1:3309

# The Lua script file to be loaded. Note that the script file is not
# physically loaded and parsed until a connection is made. Also note
# that the specified Lua script is reloaded for each connection. This
# Lua-script for read/write splitting is a standard script that is
# included in MySQL Proxy and we have not made any changes to it.
# ----------------------------------------------------------------------
# lua-cpath=D:/mysql-proxy-0.8.1-win32-x86/bin/lua-proxy/
# lua-path=D:/mysql-proxy-0.8.1-win32-x86/
proxy-lua-script=D:/mysql-proxy-0.8.1-win32-x86/share/doc/mysql-proxy/rw-splitting.lua

What can i do to make the lua script work?



Edited 1 time(s). Last edit at 10/21/2010 02:13AM by Fred Fred.

Options: ReplyQuote


Subject
Views
Written By
Posted
Unable to get Lua Scripts to work (MySQL Proxy 0.8.1-win32-x86)
10095
October 18, 2010 10:39AM


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.