I tried running the hello world lua UDF example. After creating the hello.lua file in the default udf directory (/opt/aeropsike/usr/udf/lua), I start the server and the file is deleted. I set the permissions on the file to 555, so nobody except the root user can write to the file or delete it. But still the file gets deleted. Has anyone faced this problem and what is the solution. Thank you in advance.
You have to register your this in Aerospike.
The Hello World UDF Example.
The simple end-to-end Hello World example would proceed as follows:
We take our Hello World UDF and place it into a Lua Module called hello.lua
function hello_world(topRec) return "Hello World" end
We will use the “aql” tool for this example. We perform the following steps:
- Start the AQL session by typing “aql”.
- Register the lua module “hello.lua”
- Show the currently registered modules
- Insert a regular record into the database
- Retrieve that record to make sure the insert was successful
- Execute the hello_world() UDF on recently inserted record.
I am having this same problem, and I am following the steps you outlined. After trying to register the module from the aql command line, I get the following error:
Error: cannot open file : No such file or directory
My lua script is in /opt/aerospike/usr/udf/lua
I’m experiencing similar issues: My single node (test setup) would run for weeks. Suddenly, all my lua files would disappear from /opt/aerospike/usr/udf/lua which I persisted by adding a volume to the used docker container. In which circumstances would aerospike remove lua files? Does it have to do anything with new docker containers being pulled while database is running?
Any hints are highly appreciated! Cheers Korbi