Virtual IP Address Overview
What Is a Virtual IP Address?
- Bind one or more virtual IP addresses to a cloud server so that you can use either the virtual IP address or private IP address to access the server. If you have multiple services running on a cloud server, you can use different virtual IP addresses to access them.
- Bind a virtual IP address to multiple cloud servers. You can use a virtual IP address and an HA software (such as Keepalived) to set up a high-availability active/standby cluster. If you want to improve service availability and eliminate single points of failure, you can deploy cloud servers in the active/standby pair or deploy one cloud server and multiple standby cloud servers. In this case, the cloud servers can use the same virtual IP address. If the active cloud server goes down, the standby cloud server becomes the active server and continues to provide services.
- Private IP addresses are used for internal network communication.
- The virtual IP address works with Keepalived to build an HA cluster. ECSs in this cluster can be accessed through one virtual IP address.
- EIPs are used for Internet communication.
Application Scenarios
You can use a virtual IP address and Keepalived to set up a high-availability active/standby cluster. If the active cloud server goes down, the standby server becomes the active server and continues to provide services. The following describes the typical application scenarios of virtual IP addresses.
Figure 2 shows a high-availability cluster that is set up using a virtual IP address and Keepalived. They work as follows:
- Virtual IP address 192.168.0.177 is bound to ECS-HA1 and ECS-HA2. Keepalived is configured on the two ECSs.
- EIP EIP-A is bound to the virtual IP address so that the ECSs can be accessed from the Internet.
In this cluster, ECS-HA1 works as the active ECS and provides services accessible from the Internet using EIP-A. ECS-HA2 works as the standby ECS, with no services deployed on it. If ECS-HA1 goes down, ECS-HA2 takes over services, ensuring service continuity.
For details about how to set up an HA cluster, see Using a Virtual IP Address and Keepalived to Set Up a High-Availability Web Cluster.
- Virtual IP address 10.10.1.10 is bound to ECS-01 and ECS-02. Keepalived and LVS (DR mode) are configured on ECS-01 and ECS-02 to set up the active/standby LVS servers. In this way, requests from clients can be evenly distributed to different backend servers.
- ECS-03 and ECS-04 are configured as backend servers to handle service requests.
- The source/destination check option needs to be disabled.
When you bind a virtual IP address to an ECS, the source/destination check option of the ECS NIC is automatically disabled. If the option is not disabled, disable it.
For details about how to install and configure Keepalived and LVS services and how to configure backend servers, see the common practices in the industry.
Virtual IP Address Quotas
Item |
Default Quota |
Adjustable |
---|---|---|
Maximum number of virtual IP addresses per region |
2 |
Yes. For details, see Managing Quotas. |
Maximum number of EIPs that a virtual IP address can be bound to. |
1 |
No |
Maximum number of instances (including ECSs and NICs) that a virtual IP address can be bound to. |
10 |
No |
Notes and Constraints
- If an ECS has multiple network interfaces that are in the same subnet, you are not advised to bind virtual IP addresses to the network interfaces. Using the virtual IP addresses may cause route conflicts on the ECS, which would lead to communication failures.
- A virtual IP address is assigned from a VPC subnet. They can only be bound to a cloud server in the same subnet as the virtual IP address.
- Virtual IP addresses and extended network interfaces cannot be used to directly access Huawei Cloud services, such as DNS. You can use VPCEP to access these services. For details, see Buying a VPC Endpoint.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot