[alibaba/tengine]动态upstream + upstream server 探活

2024-07-10 771 views
6

嗨~ 我现在有两个需求 1.upstream 可以动态修改 2.upstream 的server 可以进行探活

我采用了ngx_http_dyups_module +ngx_http_upstream_check_module 但是后来发现 ngx_http_dyups_module文档中说明不支持ngx_http_upstream_check_module。(https://github.com/alibaba/tengine/blob/master/docs/modules/ngx_http_dyups_module.md

请问还有什么别的模块可以支持吗 ? 非常感谢~ 很急。 #

回答

8

你的需求是动态的增删upstream,不是动态的增删upstream 里的server?

2

The document is out of date, now the dyups can work well with upstream_check.

6

ngx_http_dyups_module,这个没有合并相同后端服务器,2.1.2 说合并了,http://tengine.taobao.org/changelog_cn.html

lua-resty-upstream-healthcheck,这个检查upstream 健康状态的 总是报错,[error] 20617#0: [lua] healthcheck.lua:59: errlog(): healthcheck: failed to run healthcheck cycle: attempt to yield across metamethod/C-call boundary, context: ngx.timer 这是啥原因?

7

@hxj412327668 根据你的日志提示是由于do_check函数执行出错导致的,你可以通过在do_check函数中添加相关日志看看具体是哪个调用位置出错,然后具体分析。

3

@yzprofile 官网文档要改了,上面还写不兼容http://tengine.taobao.org/document_cn/http_dyups_cn.html

Description
This module can be used to update your upstream-list without reloadding Nginx.

TODO:

It can not work with common `nginx_upstream_check_module`.