在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/網(wǎng)絡安全/ lua 問題 open-falcon 出錯

lua 問題 open-falcon 出錯

2018/05/17 22:35:44 [error] 54034#0: *11 lua entry thread aborted: runtime error: /usr/local/nginx/modules/ngx_metric_output.lua:3: module 'ngx_metric.counter' not found:
        no field package.preload['ngx_metric.counter']
        no file 'modules/ngx_metric/counter.lua'
        no file './ngx_metric/counter.lua'
        no file '/usr/local/LuaJIT/share/luajit-2.0.2/ngx_metric/counter.lua'
        no file '/usr/local/share/lua/5.1/ngx_metric/counter.lua'
        no file '/usr/local/share/lua/5.1/ngx_metric/counter/init.lua'
        no file '/usr/local/LuaJIT/share/lua/5.1/ngx_metric/counter.lua'
        no file '/usr/local/LuaJIT/share/lua/5.1/ngx_metric/counter/init.lua'
        no file './ngx_metric/counter.so'
        no file '/usr/local/lib/lua/5.1/ngx_metric/counter.so'
        no file '/usr/local/LuaJIT/lib/lua/5.1/ngx_metric/counter.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './ngx_metric.so'
        no file '/usr/local/lib/lua/5.1/ngx_metric.so'
        no file '/usr/local/LuaJIT/lib/lua/5.1/ngx_metric.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
coroutine 0:
        [C]: in function 'require'
        /usr/local/nginx/modules/ngx_metric_output.lua:3: in function </usr/local/nginx/modules/ngx_metric_output.lua:1>, client: 127.0.0.1, server: 127.0.0.1, request: "GET /monitor/basic_status HTTP/1.1", host: "127.0.0.1:9091"
2018/05/17 22:35:44 [error] 54034#0: *11 failed to run log_by_lua*: /usr/local/nginx/modules/ngx_metric.lua:4: module 'ngx_metric.util' not found:
        no field package.preload['ngx_metric.util']
        no file 'modules/ngx_metric/util.lua'
        no file './ngx_metric/util.lua'
        no file '/usr/local/LuaJIT/share/luajit-2.0.2/ngx_metric/util.lua'
        no file '/usr/local/share/lua/5.1/ngx_metric/util.lua'
        no file '/usr/local/share/lua/5.1/ngx_metric/util/init.lua'
        no file '/usr/local/LuaJIT/share/lua/5.1/ngx_metric/util.lua'
        no file '/usr/local/LuaJIT/share/lua/5.1/ngx_metric/util/init.lua'
        no file './ngx_metric/util.so'
        no file '/usr/local/lib/lua/5.1/ngx_metric/util.so'
        no file '/usr/local/LuaJIT/lib/lua/5.1/ngx_metric/util.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
        no file './ngx_metric.so'
        no file '/usr/local/lib/lua/5.1/ngx_metric.so'
        no file '/usr/local/LuaJIT/lib/lua/5.1/ngx_metric.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        /usr/local/nginx/modules/ngx_metric.lua:4: in function </usr/local/nginx/modules/ngx_metric.lua:1> while logging request, client: 127.0.0.1, server: 127.0.0.1, request: "GET /monitor/basic_status HTTP/1.1", host: "127.0.0.1:9091"

提示 module 'ngx_metric.counter' not found: 沒找到

但是我是有這個文件的

modules/
├── avg.lua
├── chunk_histogram.lua
├── counter.lua
├── histogram.lua
├── ngx_metric
│   ├── avg.lua
│   ├── chunk_histogram.lua
│   ├── counter.lua
│   ├── histogram.lua
│   ├── ngx_metric.lua
│   └── util.lua
├── ngx_metric.lua
├── ngx_metric_output.lua
└── util.lua   

cat /usr/local/nginx/modules/ngx_metric.lua 的部分代碼

 

local util = require "ngx_metric.util"
local counter = require "ngx_metric.counter"
local chunkhisto = require "ngx_metric.chunk_histogram"

local _M = { _VERSION = '0.0.1' }
local mt = { __index = _M }

local function cut_uri(uri, section_len)
    local uri_a = util.str_split(uri, "/")
    local res = ""
    for i = 1, math.min(section_len, #uri_a) do
        res = res .. "/" .. uri_a[i]
    end
    return res
end
回答
編輯回答
瞄小懶

這個一般是ngx的啟動路徑問題,ngx_metric.conf配置的是相對路徑,所有你的環(huán)境需要在/usr/local/nginx下面啟動圖片描述

2017年11月22日 18:46
編輯回答
脾氣硬

這里是哪里出錯了?幫忙看下

2018年5月30日 07:47