Enabling and disabling traffic transfer from an availability zone
If there is maintenance or issues in one of the availability zones, Yandex Cloud technicians can redirect traffic to other zones. You can test this process, to see how traffic transfer works.
Enabling traffic transfer
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
-
See the description of the command to enable traffic transfer from an availability zone:
yc application-load-balancer load-balancer start-zonal-shift --help
-
Get a list of all L7 load balancers in the default folder:
yc application-load-balancer load-balancer list
Result:
+----------------------+-----------------------+-------------+----------------+---------+ | ID | NAME | REGION ID | LISTENER COUNT | STATUS | +----------------------+-----------------------+-------------+----------------+---------+ | ds70q425egoe******** | my-balancer | ru-central1 | 1 | ACTIVE | | f3da23i86n2v******** | new-balancer | ru-central1 | 1 | ACTIVE | +----------------------+-----------------------+-------------+----------------+---------+
-
Enable traffic transfer:
yc application-load-balancer load-balancer start-zonal-shift \ <load_balancer_name_or_ID> \ --zone <availability_zone>
Result:
id: ds70q425egoe******** name: my-balancer ... allocation_policy: locations: - zone_id: ru-central1-b subnet_id: e2lptlobccu6******** - zone_id: ru-central1-a subnet_id: e9bo5ir5prfi******** zonal_shift_active: true ...
To enable traffic transfer, use the startZonalShift REST API method for the LoadBalancer resource or the LoadBalancerService/StartZonalShift gRPC API call.
Disabling traffic transfer
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID>
command. You can also set a different folder for any specific command using the --folder-name
or --folder-id
parameter.
-
See the description of the command to disable traffic transfer from an availability zone:
yc application-load-balancer load-balancer cancel-zonal-shift --help
-
Get a list of all L7 load balancers in the default folder:
yc application-load-balancer load-balancer list
Result:
+----------------------+-----------------------+-------------+----------------+---------+ | ID | NAME | REGION ID | LISTENER COUNT | STATUS | +----------------------+-----------------------+-------------+----------------+---------+ | ds70q425egoe******** | my-balancer | ru-central1 | 1 | ACTIVE | | f3da23i86n2v******** | new-balancer | ru-central1 | 1 | ACTIVE | +----------------------+-----------------------+-------------+----------------+---------+
-
Disable traffic transfer:
yc application-load-balancer load-balancer cancel-zonal-shift \ <load_balancer_name_or_ID> \ --zone <availability_zone>
Result:
id: ds70q425egoe******** name: my-balancer ... allocation_policy: locations: - zone_id: ru-central1-b subnet_id: e2lptlobccu6******** - zone_id: ru-central1-a subnet_id: e9bo5ir5prfi******** ...
To disable traffic transfer, use the cancelZonalShift REST API method for the LoadBalancer resource or the LoadBalancerService/CancelZonalShift gRPC API call.