GoneGo1ng opened a new issue #4375:
URL: https://github.com/apache/apisix/issues/4375


   ### Issue description
   
   The healthcheck is configured upstream and is already up and running, but 
calling the 'v1/healthcheck' interface does not return the expected result, 
instead returning an empty json.
   One more question, I only created an upstream. Why does 
'apisix/admin/upstreams' return a count of 2?
   
   ```
   This is the service log, indicating that the health check is running 
normally.
   
   ...
   [GIN] 2021/06/04 - 10:01:34 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   [GIN] 2021/06/04 - 10:01:39 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   [GIN] 2021/06/04 - 10:01:49 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   [GIN] 2021/06/04 - 10:01:54 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   [GIN] 2021/06/04 - 10:01:59 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   [GIN] 2021/06/04 - 10:02:09 | 200 |            0s |     172.16.4.41 |GET     
 "/ping"
   ...
   ```
   
   ```
   curl "http://172.16.4.41:9090/v1/healthcheck";
   
   {}
   ```
   
   ```
   curl "http://172.16.4.41:9080/apisix/admin/upstreams"; -H 'X-API-KEY: 
edd1c9f034335f136f87ad84b625c8f1'
   
   {
       "count": "2",
       "action": "get",
       "node": {
           "dir": true,
           "nodes": [
               {
                   "value": {
                       "name": "httpbin-upstream",
                       "scheme": "http",
                       "type": "roundrobin",
                       "pass_host": "pass",
                       "hash_on": "vars",
                       "id": "357655931518976703",
                       "update_time": 1622719457,
                       "nodes": [
                           {
                               "weight": 1,
                               "port": 7777,
                               "host": "172.16.65.34",
                               "priority": 0
                           },
                           {
                               "weight": 1,
                               "port": 7778,
                               "host": "172.16.65.34",
                               "priority": 0
                           }
                       ],
                       "timeout": {
                           "connect": 6,
                           "read": 6,
                           "send": 6
                       },
                       "checks": {
                           "active": {
                               "concurrency": 10,
                               "http_path": "\/ping",
                               "https_verify_certificate": true,
                               "timeout": 5,
                               "healthy": {
                                   "interval": 5,
                                   "successes": 1,
                                   "http_statuses": [
                                       200,
                                       201
                                   ]
                               },
                               "unhealthy": {
                                   "http_statuses": [
                                       400,
                                       404,
                                       500
                                   ],
                                   "http_failures": 2,
                                   "tcp_failures": 2,
                                   "timeouts": 3,
                                   "interval": 5
                               },
                               "type": "http"
                           }
                       },
                       "create_time": 1622709147
                   },
                   "key": "\/apisix\/upstreams\/357655931518976703",
                   "modifiedIndex": 228,
                   "createdIndex": 18
               }
           ],
           "key": "\/apisix\/upstreams"
       }
   }
   ```
   
   ```
   ```
   
   ### Environment
   
   Request help without environment information will be ignored or closed.
   
   * apisix version (cmd: `apisix version`): 2.5
   
   * OS (cmd: `uname -a`): Linux 74e6fc1aaa26 3.10.0-1127.13.1.el7.x86_64 #1 
SMP Tue Jun 23 15:46:38 UTC 2020 x86_64 Linux
   * OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): 
openresty/1.19.3.1
   * etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): 
3.4.0
   * apisix-dashboard version, if have: 2.6
   * luarocks version, if the issue is about installation (cmd: `luarocks 
--version`): 3.5.0
   


-- 
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:
[email protected]


Reply via email to