简体   繁体   中英

How to replace GCP Load Balancer Backend Service Health Check via gcloud

I have some "Classic" HTTP load balancers in my GCP project. Now I need to switch the health check used in one of the backend services.

Here you see in the GUI what I want to do: 在此处输入图像描述

However, as you can see, I got a warning not to change anything via GUI.

So, how do I do this via the gcloud command line tool? Could not find any hint in the docs, unfortunately.

Or can I ignore this warning and just go ahead?

This warning can be ignored. In case if the health check is not updated then follow these steps to update the health check through gcloud commands .

If you know the name of the backend service which you are trying to update the health check, you can use the following command:

gcloud compute backend-services update BACKEND_SERVICE_NAME \
    --region=REGION \
    --health-checks=HEALTH_CHECK_NAME \
    --health-checks-region=REGION

Refer this document for more information about the backend-service update command.

In case you don't know the name of the backend-services attached to the load balancer follow this document to get the list of backend services used by the load balancer. By using the backend service name we can update the health check through gcloud command line tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM