如何在nifi Processor ExecuteScript中定义lua模块路径?

时间:2017-04-27 01:09:16

标签: module lua apache-nifi

我是Lua的新手。

几天前,我在NIFI的ExecuteScript中使用python进行了编译。我将Python模块路径设置为/usr/local/lib/python2.7/dist-packages。一切顺利。

但对Lua做同样的事情对我来说太难了。始终错误无法找到模块!!!

我使用Luarock安装模块。

您能告诉我如何设置lua模块路径或一些有用的信息吗?

以下是我的Luarocks设置的一些信息:

lbh@es-2:~/install/nifi-1.1.1/lua_modules$ luarocks list

Installed rocks:

----------------

lua-cjson
   2.1.0-1 (installed) - /usr/local/lib/luarocks/rocks

luasocket
   3.0rc1-2 (installed) - /usr/local/lib/luarocks/rocks

redis-lua
   2.0.4-1 (installed) - /usr/local/lib/luarocks/rocks

lua-cjson的一个例子。

lbh@es-2:~/install/nifi-1.1.1/lua_modules$ luarocks show lua-cjson

lua-cjson 2.1.0-1 - A fast JSON encoding/parsing module

The Lua CJSON module provides JSON support for Lua. It features: - Fast,
standards compliant encoding/parsing routines - Full support for JSON with
UTF-8, including decoding surrogate pairs - Optional run-time support for
common exceptions to the JSON specification (infinity, NaN,..) - No
dependencies on other libraries

License:    MIT
Homepage:   http://www.kyne.com.au/~mark/software/lua-cjson.php
Installed in:   /usr/local

Modules:
    cjson
    lua2json
    json2lua
    cjson.util

/usr/local/lib/luarocks/rocks

的目录信息
lbh@es-2:~/install/nifi-1.1.1/lua_modules$ ls -l /usr/local/lib/luarocks/rocks
total 16
drwxr-xr-x 3 root root 4096 Mar 17 11:13 lua-cjson
drwxr-xr-x 3 root root 4096 Mar 17 11:18 luasocket
-rw-r--r-- 1 root root 3653 Mar 17 11:18 manifest
drwxr-xr-x 3 root root 4096 Mar 17 11:18 redis-lua

0 个答案:

没有答案