NGINX笔记之: Tengine编译安装Tengine/2.3.1编译安装踩坑笔记

Tengine/2.3.1 编译安装

花了不少的时间才搞定的问题

问题背景,之前使用tengine发现用这个的健康检查蛮好的,可以配置界面去看后端应用状态,也可以通过这个输出数据做应用状态检查。最近需要部署一批机器,单NG就有10多个节点,新机器当然用新版本的NG,结果发现旧配置无法使用,坑了老爹,发现死活健康检查用不了,后边发现原来是:ngx_http_upstream_check_module 这个健康检查模块没了,NND 官方文档也没个说明,在github上找到了答案, 编译时加上参数:–add-module=./modules/ngx_http_upstream_check_module 。
顺便吐槽下,nginx的编译真的好慢,为了验证这个问题编译了好几次,贼吐血的问题啊!

我的编译参数:

./configure   --prefix=/opt/nginx --user=apps --group=apps --with-threads --with-http_ssl_module --with-http_sub_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_realip_module --with-http_addition_module --with-http_v2_module --with-openssl=/opt/tools/openssl-1.1.1c --with-pcre=/opt/tools/pcre-8.43 --with-zlib=/opt/tools/zlib-1.2.11 --with-jemalloc=/opt/tools/jemalloc-5.1.0 --add-module=/opt/tools/ngx_http_substitutions_filter_module-master --add-module=/opt/tools/ngx_devel_kit-master --add-module=/opt/tools/ngx_cache_purge-2.3 --add-module=./modules/ngx_http_upstream_check_module --add-module=./modules/ngx_http_upstream_session_sticky_module --add-module=./modules/ngx_http_upstream_dynamic_module 

make && make install

检查安装模块情况:

/opt/nginx/sbin/nginx -m

没有健康检查模块的报错情况

/opt/nginx/sbin/nginx -t nginx: [emerg] unknown directive “check” in
/opt/nginx/conf/upstream.conf:8 nginx: configuration file
/opt/nginx/conf/nginx.conf test failed

因为在:upstream 中加入了:

  check interval=3000 rise=2 fall=5 timeout=1000 type=http;

注:

淘宝的 Tengine 升级到 2.3.0 或者2.3.1 都不再默认安装健康检查模块,默认就支持ipv6,这个导致了上边的坑。

上一篇:Some untracked working tree files would be overwritten by checkout. Please move or remove them before you can checkout. View them


下一篇:Translate Angular >=4 with ngx-translate and multiple modules