Should I install LUA separate from Aerospike?


#1

Hi,

I was trying to use snappy compression for LUA (https://github.com/fperrad/lua-csnappy) It needs. lua.h for compiling Should I install LUA separate from aerospike?


#2

Are you trying to use Snappy with Lua inside the Aerospike server? That would be cool.

I’m pretty sure Aerospike server uses a static link of Lua, since we’ve had issues with different installed versions of Lua.

If you want to run against a different version, I believe there’s a compile process for it — but Aerospike currently supports the imbedding syntax of 5.1 only. If you’re OK with that, and want to hack into the compile process the Snappy library, it should be doable. I’d start by doing an aerospike source compile, find the lua module, and work to integrate Snappy with that, but you could also point the Aerospike server build at the built-in Lua (again, assuming Lua 5.1).


#3

I am trying https://github.com/bungle/lua-resty-snappy

####1.Have compiled to -> libsnappy.so, and moved it to /usr/lib/ ####2.Then I created snappy.lua like this https://github.com/bungle/lua-resty-snappy/blob/master/lib/resty/snappy.lua ####3. Added snappy.lua with aql ####4. I have local snappy = require(“snappy”) from another lua file

I am trying to run that udf from aql , but getting ###Error: (-1) Bad file descriptor

And after that seems aql cant connect ,

I am getting ###WARN AEROSPIKE_ERR_CLIENT Socket write error: 111 ###Error -1: Failed to seed cluster


#4

This is likely an indicator that the lua did not execute correctly. Is there any log on the server side?


#5

We tested https://github.com/forhappy/lua-snappy LUA snappy library and compiled it with LUA 5.1, and it works fine.

I am also going to write a blog post and describe how to use lua snappy and cjson C libraries within Aerospike UDF. Hope it will be helpful for community.


#6

Hi forkize,

That would be great, thanks! I look forward to reading your blog post and, upon review, publishing it on our guest blog. I am now following you on Twitter, so if you tweet it out, I will be happy to retweet to our community.

We welcome these contributions from the Aerospike community and hope that yours will inspire others to do the same!

Cheers,

Maud
Aerospike Community Manager
Twitter: @Mnemaudsyne


#7

Hi forkize,

Can you please share the link to the blog or the link to the sample LUA code which using the Snappy compression. Thanks again for working on this.

-Idris InMobi