Skip to content

request help: active health check doesn't work #1555

@panhow

Description

@panhow

Issue description

I enabled the upstream ACTIVE health check(NOT PASSIVE), but it didn't health check the upstream endpoint actively.
I check the error.log,health checks only happened while i curl the route.
I want the health check to help me check whether the endpoint is Connection Refused or Connection Timeout

Environment

curl -XPUT localhost:9080/apisix/admin/upstreams/00000000000000000356 -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' --data '
{
  "enable_websocket": true,
  "hash_on": "vars",
  "id": "00000000000000000356",
  "nodes": {
    "127.0.0.1:8000": 10,
    "127.0.0.1:6666": 10,
    "127.0.0.1:8888": 10
  },
  "desc": "test-health-check",
  "type": "roundrobin",
  "checks": {
    "active": {
      "unhealthy": {
        "interval": 3,
        "http_failures": 253,
        "tcp_failures": 5
      },
      "type": "http",
      "http_path": "/"
    }
  }
}'

curl http://127.0.0.1:9080/apisix/admin/routes/1  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
    "methods": ["GET"],
    "uri": "/test/index.html",
    "upstream_id": "00000000000000000356"
}'
➜   incubator-apisix git:(master) ✗ telnet 127.0.0.1 6666
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
^C
Connection closed by foreign host.
➜  incubator-apisix git:(master) ✗ telnet 127.0.0.1 8888
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
➜  incubator-apisix git:(master) ✗ telnet 127.0.0.1 8000
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host
  • error.log
    image

  • apisix version (cmd: apisix version):1.2

  • OS:os X

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions