Mac 설치 Kong (2) OpenResty 'nginx' 실행 파일 을 찾 을 수 없습니다.
Mac 설치 Kong (2) OpenResty 'nginx' 실행 파일 을 찾 을 수 없습니다.
나중에 동료 들 을 도와 nginx 를 디 버 깅 하고 현지에서 nginx 를 따로 설치 해서 openresty 를 닫 았 습 니 다.검증 이 끝 난 후 openresty 와 kong 을 다시 시작 하 니 아무리 해도 작 동 하지 않 는 다.
# kong
kong start -c /etc/kong/kong.conf
#
Error: /usr/local/share/lua/5.1/kong/cmd/start.lua:41: could not find OpenResty 'nginx' executable. Kong requires version 1.15.8.1 to 1.15.8.3
Run with --v (verbose) or --vv (debug) for more details
질문
그래서 kong start - c / etc / kong / kong. conf -- vv 를 통 해 구체 적 인 로 그 를 봅 니 다.
2020/07/06 15:32:26 [debug] searching for OpenResty 'nginx' executable
2020/07/06 15:32:26 [debug] /usr/local/openresty/nginx/sbin/nginx -v: 'sh: /usr/local/openresty/nginx/sbin/nginx: No such file or directory'
2020/07/06 15:32:26 [debug] OpenResty 'nginx' executable not found at /usr/local/openresty/nginx/sbin/nginx
2020/07/06 15:32:26 [debug] /opt/openresty/nginx/sbin/nginx -v: 'sh: /opt/openresty/nginx/sbin/nginx: No such file or directory'
2020/07/06 15:32:26 [debug] OpenResty 'nginx' executable not found at /opt/openresty/nginx/sbin/nginx
2020/07/06 15:32:26 [verbose] could not start Kong, stopping services
2020/07/06 15:32:26 [debug] sending signal to pid at: /usr/local/opt/kong/pids/nginx.pid
2020/07/06 15:32:26 [debug] kill -0 `cat /usr/local/opt/kong/pids/nginx.pid` >/dev/null 2>&1
2020/07/06 15:32:26 [verbose] stopped services
Error:
/usr/local/share/lua/5.1/kong/cmd/start.lua:79: /usr/local/share/lua/5.1/kong/cmd/utils/log.lua:63: bad argument #4 to 'format' (no value)
stack traceback:
[C]: in function 'error'
/usr/local/share/lua/5.1/kong/cmd/start.lua:79: in function 'cmd_exec'
/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function
[C]: in function 'xpcall'
/usr/local/share/lua/5.1/kong/cmd/init.lua:88: in function
/usr/local/bin/kong:9: in function 'file_gen'
init_worker_by_lua:49: in function <47>
[C]: in function 'xpcall'
init_worker_by_lua:56: in function <54/>
이상 한 위 에 error 로그 가 있 습 니 다.
/usr/local/openresty/nginx/sbin/nginx -v: 'sh: /usr/local/openresty/nginx/sbin/nginx: No such file or directory'
2020/07/06 15:32:26 [debug] OpenResty 'nginx' executable not found at /usr/local/openresty/nginx/sbin/nginx
2020/07/06 15:32:26 [debug] /opt/openresty/nginx/sbin/nginx -v: 'sh: /opt/openresty/nginx/sbin/nginx: No such file or directory'
분명 합 니 다. kong 을 시작 할 때 입 니 다. openresty 는 nginx 의 효과 적 인 경 로 를 찾 지 못 했 습 니 다. (nginx 의 경로 가 단독 설치 로 인해 어떻게 바 뀌 었 는 지 모 르 겠 습 니 다)
그래서 kong 의 스 크 립 트 에 따라 어디 에 쓰 인 nginx 시작 경 로 를 찾 습 니 다.
sudo find / name kong 을 사용 하여 kong 의 디 렉 터 리 를 찾 습 니 다.
/usr/local/share/lua/5.1/kong
/usr/local/share/lua/5.1/kong/cmd pwd
/usr/local/share/lua/5.1/kong/cmd
# kong , , nginx
/usr/local/share/lua/5.1/kong/cmd ls
check.lua health.lua init.lua prepare.lua reload.lua roar.lua stop.lua version.lua
config.lua hybrid.lua migrations.lua quit.lua restart.lua start.lua utils
# utils , nginx_signals.lua, , nginx_signals.lua.bak ,
/usr/local/share/lua/5.1/kong/cmd cd utils
/usr/local/share/lua/5.1/kong/cmd/utils ls
env.lua log.lua nginx_signals.lua prefix_handler.lua
kill.lua migrations.lua nginx_signals.lua.bak tty.lua
tangfeng@MacBook-Pro /usr/local/share/lua/5.1/kong/cmd/utils
/ usr / local / share / lu / 5.1 / kong / cmd / utils 에서 nginx 를 설정 한 디 렉 터 리 를 발견 한 후 openrestiy 의 설치 디 렉 터 리 를 찾 아 nginx 가 있 는 경 로 를 찾 아 설정 하면 됩 니 다.
local nginx_search_paths = {
--"/usr/local/openresty/nginx/sbin",
--"/opt/openresty/nginx/sbin",
-- "/usr/local/bin", -- nginx , ,
"/usr/local/Cellar/openresty/1.15.8.3_1/nginx/sbin" -- openresty nginx,
}
위의 조작 이 끝 난 후, 마침내 정상적으로 작 동 할 수 있 게 되 었 다.
\ # 시작 kong kong start -c /etc/kong/kong.conf
brew 로 설치 가 잘 되 지 않 은 곳 은, 우 리 는 그것 이 어떤 디 렉 터 리 에 설치 되 었 는 지, 기 존의 무엇 에 영향 을 주 었 는 지, 이것 은 약간 구덩이 가 있다 는 것 이다.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
OpenResty 관련 nginx 및 lua 함수루 아 코드 를 어떻게 사용 하 는 지 소개 한다.두 가지 방법 이 있 습 니 다.첫 번 째, server 의 location 에 직접 삽입 합 니 다. Nginx subrequest 를 통 해 다른 location...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.