Hello list,
I’m using HAProxy-1.6 with Lua. My use case involves a Lua extension
library LuaSocket and I’m having problems configuring HAProxy to use
LuaSocket.
When I use LuaSocket directly in Lua everything works fine:
[bowen ~]$ lua
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> require("socket")
table: 0x22faef0
>
However there are some problems when I use LuaSocket in a Lua file loaded
by HAProxy.
My config looks like:
global
lua-load hello.lua
…
…
My hello.lua is very simple:
require(“socket”)
It’s throwing the following error:
[bowen ~]$ haproxy -f config -c
[ALERT] 162/193812 (5636) : parsing [config:2] : lua runtime error: error
loading module 'socket.core' from file
'/usr/local/lib/lua/5.3/socket/core.so':
/usr/local/lib/lua/5.3/socket/core.so: undefined symbol: lua_getmetatable
My environment is linux 2.6.32. LuaSocket was installed via LuaRocks
Any ideas? Thanks in advance.
Best,
Bowen
I’m using HAProxy-1.6 with Lua. My use case involves a Lua extension
library LuaSocket and I’m having problems configuring HAProxy to use
LuaSocket.
When I use LuaSocket directly in Lua everything works fine:
[bowen ~]$ lua
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
> require("socket")
table: 0x22faef0
>
However there are some problems when I use LuaSocket in a Lua file loaded
by HAProxy.
My config looks like:
global
lua-load hello.lua
…
…
My hello.lua is very simple:
require(“socket”)
It’s throwing the following error:
[bowen ~]$ haproxy -f config -c
[ALERT] 162/193812 (5636) : parsing [config:2] : lua runtime error: error
loading module 'socket.core' from file
'/usr/local/lib/lua/5.3/socket/core.so':
/usr/local/lib/lua/5.3/socket/core.so: undefined symbol: lua_getmetatable
My environment is linux 2.6.32. LuaSocket was installed via LuaRocks
Any ideas? Thanks in advance.
Best,
Bowen