You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/14 07:02:16 UTC

[GitHub] [apisix] gewei2000 edited a comment on issue #2739: request help: health check not working

gewei2000 edited a comment on issue #2739:
URL: https://github.com/apache/apisix/issues/2739#issuecomment-727157470


   > my env( apisix master + dashboard 2.0) can not reproduce your issue, my route like this:
   > 
   > ```shell
   > curl http://127.0.0.1:9080/apisix/admin/routes/1 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
   > {
   >     "uri": "/404.html",
   >     "upstream": {
   >          "nodes": {
   >             "192.168.0.2": 1,
   >             "127.0.0.1:9797": 1
   >         },
   >         "type": "roundrobin",
   >         "retries": 2,
   >         "checks": {
   >             "active": {
   >                 "timeout": 5,
   >                 "http_path": "/404.html",
   >                 "healthy": {
   >                     "interval": 2,
   >                     "successes": 1
   >                 },
   >                 "unhealthy": {
   >                     "interval": 1,
   >                     "http_failures": 2
   >                 },
   >                 "req_headers": ["User-Agent: curl/7.29.0"]
   >             }
   >         }
   >     }
   > }'
   > ```
   > 
   > after I close `127.0.0.1:9797`, APISIX's `error.log` show it only sent tow times traffic to the `127.0.0.1:9797`
   > 
   > ```
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:38 [warn] 95077#3298494: *1505367 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (1/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for 'foo.com(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > 2020/11/14 11:13:41 [warn] 95077#3298494: *1505577 [lua] healthcheck.lua:1107: log(): [healthcheck] (upstream#/apisix/routes/1) unhealthy TCP increment (2/2) for '(127.0.0.1:9797)', context: ngx.timer, client: 127.0.0.1, server: 0.0.0.0:9080
   > ```
   > 
   > Then no more traffic to the `127.0.0.1:9797`.
   > But the log has another issue: there are redundant logs, I will report that. #2745
   
   my env(docker:apache/apisix:2.0-centos + dashboard 2.0 ), it also can not work, you can try use this json data
   my json data 
   ```
   {"name":"small_policy_center","type":"roundrobin","retries":2,"timeout":{"connect":6000,"send":6000,"read":6000},"nodes":[{"host":"9.23.27.152","port":7001,"weight":1},{"host":"9.23.27.226","port":7001,"weight":1}],"checks":{"active":{"healthy":{"interval":2,"successes":1},"http_path":"/","timeout":5,"unhealthy":{"http_failures":2,"interval":1}}}}
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org