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 2022/02/25 13:50:04 UTC

[GitHub] [apisix] nic-6443 commented on issue #6443: request help: upstream how to do failover

nic-6443 commented on issue #6443:
URL: https://github.com/apache/apisix/issues/6443#issuecomment-1050869844


   > > See https://apisix.apache.org/docs/apisix/next/architecture-design/upstream/, you can refer to the node priority.
   > 
   > This should not meet my requirement, my requirement is that under normal circumstances the request will only hit node A and node B. Only if both node A and node B are down, the request will auto go to node C.
   
   Please read the upstream documentation carefully, this function can be achieved by node priority and active healthy check, there is a very clear demonstration case in the documentation, similar to the following:
   ```shell
   curl --location --request PUT 'http://apisix-admin:9180/apisix/admin/routes/failover' \
   --header 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
   --header 'Content-Type: application/json' \
   --data-raw '{
       "host": "failover",
       "uri": "/*",
       "upstream": {
           "type": "roundrobin",
           "nodes": [
               {"host": "172.30.45.124", "port": 80, "weight": 1},
               {"host": "172.30.45.125", "port": 80, "weight": 1},
               {"host": "172.30.45.126", "port": 80, "weight": 1, "priority": -1}
           ],
           "checks": {
               "active": {
                   "http_path": "/status/200",
                   "healthy": {
                       "interval": 1,
                       "successes": 1
                   },
                   "unhealthy": {
                       "interval": 1,
                       "http_failures": 1
                   }
               }
           }
       },
       "name": "failover"
   }'
   ```
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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