-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: 2.13.1 /v1/healthycheck 获取不到upstream 健康状态 #7141
Comments
Is this a steadily recurring problem, or an occasional one? |
Is it because there is no request sent to the upstream? As https://github.com/apache/apisix/blob/master/docs/en/latest/health-check.md shows,
|
有时候能看到有值 有时候 是空的 /usr/local/apisix/logs # more 2022-05-26_07-00-00__error.log 现在就是空的 |
另外 能不能集中显示一下 unhealthy_nodes , 我更关注的时候 unhealthy_nodes 能及时报警出来 ,需要及时通知监控工程师去解决unhealthy_nodes 的问题 。 尽快把服务恢复起来 。 |
local upstream_mod = require("apisix.upstream") 这个routes 就没问题 稳定的 upstreams 经常就是空的 。 2022/05/26 08:49:29 [error] 803#803: 31319311 [lua] v1.lua:106: handler(): routes: [{"clean_handlers":{},"value":{"status":1,"priority":0,"upstream_id":"409123071262202320","host":"service-yyzyh.wanzhuanmohe.cn","name":"service-yyzyh.wanzhuanmohe.cn","methods":["GET","POST"],"update_time":1653386086,"create_time":1653386086,"id":"409123293879081424","uri":"/"},"createdIndex":26,"update_count":0,"has_domain":false,"orig_modifiedIndex":26,"key":"/apisix/routes/409123293879081424","modifiedIndex":26},{"clean_handlers":{},"value":{"status":1,"priority":0,"upstream_id":"409123196135021008","host":"service-bmlt.wanzhuanmohe.cn","name":"service-bmlt.wanzhuanmohe.cn","methods":["GET","POST"],"update_time":1653386133,"create_time":1653386133,"id":"409123373017209296","uri":"/"},"createdIndex":28,"update_count":0,"has_domain":false,"orig_modifiedIndex":28,"key":"/apisix/routes/409123373017209296","modifiedIndex":28},{"clean_handlers":{},"value":{"status":1,"priority":0,"create_time":1653524709,"host":"service-yyzyh.wanzhuanmohe.cn","upstream_id":"409356277903268304","name":"service-yyzyh.wanzhuanmohe.cn/app","methods":["GET","POST"],"update_time":1653525007,"uri":"/app/","id":"409355866207164880","desc":"游戏接口域名/app 转发到广告接口"},"createdIndex":2015,"update_count":0,"has_domain":false,"orig_modifiedIndex":2018,"key":"/apisix/routes/409355866207164880","modifiedIndex":2018},{"clean_handlers":{},"value":{"status":1,"priority":0,"create_time":1653536211,"host":"serviceapi-cbdmcnssp.wanzhuanmohe.cn","upstream_id":"409356277903268304","name":"serviceapi-cbdmcnssp.wanzhuanmohe.cn","methods":["GET","POST"],"update_time":1653536211,"uri":"/","id":"409375163394562512","desc":"cbd 游戏广告接口"},"createdIndex":2068,"update_count":0,"has_domain":false,"orig_modifiedIndex":2068,"key":"/apisix/routes/409375163394562512","modifiedIndex":2068}], client: 127.0.0.1, server: , request: "GET /v1/healthcheck HTTP/1.1", host: "127.0.0.1:9090" |
Only upstream with requests sent will show their status. |
/usr/local/apisix # curl 127.0.0.1:9090/v1/upstreams <title>**500 Internal Server Error**</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style>An error occurred.You can report issue to APISIX Faithfully yours, APISIX. 是参数问题吗? /usr/local/apisix # curl 127.0.0.1:9090/v1/routes |
另外一个集群: |
In the case of multiple processes, if the process hit by the request and the process hit by the api are not the same, the health check information cannot be obtained |
That's the truth. But I don't think it's a problem. In actual use, it only happens for a very short period of time when APISIX starts up. It's just that this phenomenon is amplified in testing. As the requests increase, each worker processes the request and returns healthcheck data. |
Current Behavior
curl 127.0.0.1:9090/v1/healthcheck
{}
Expected Behavior
https://github.com/apache/apisix/blob/master/docs/en/latest/control-api.md#get-v1healthcheck
[
{
"healthy_nodes": [
{
"host": "127.0.0.1",
"port": 1980,
"priority": 0,
"weight": 1
}
],
"name": "upstream#/upstreams/1",
"nodes": [
{
"host": "127.0.0.1",
"port": 1980,
"priority": 0,
"weight": 1
},
{
"host": "127.0.0.2",
"port": 1988,
"priority": 0,
"weight": 1
}
],
"src_id": "1",
"src_type": "upstreams"
},
{
"healthy_nodes": [
{
"host": "127.0.0.1",
"port": 1980,
"priority": 0,
"weight": 1
}
],
"name": "upstream#/routes/1",
"nodes": [
{
"host": "127.0.0.1",
"port": 1980,
"priority": 0,
"weight": 1
},
{
"host": "127.0.0.1",
"port": 1988,
"priority": 0,
"weight": 1
}
],
"src_id": "1",
"src_type": "routes"
}
]
Error Logs
No response
Steps to Reproduce
1、start apisix
2、add upstream node
Environment
apisix version
):2.13.1uname -a
):centos7.9openresty -V
ornginx -V
): openresty/1.19.9.1curl http://127.0.0.1:9090/v1/server_info
):3.4.0luarocks --version
):3.8.0The text was updated successfully, but these errors were encountered: