This document describes how to create a public network Classic CLB instance named clb-test
and forward requests from clients to two real servers.
rs-1
and rs-2
have been created in the Guangzhou region in this example. For more information on how to create a CVM instance, please see Purchasing and Launching CVM Instances.rs-1
and rs-2
. Apache returns "Hello Tomcat! This is rs-1!" on rs-1
and "Hello Tomcat! This is rs-2!" on rs-2
. For more information on how to deploy components on a CVM instance, please see Deploying Java Web on Linux (CentOS) and Installing and Configuring PHP on Windows.Note:
- For traditional accounts, public network bandwidth must be purchased for the CVM instances, as the bandwidth is billed by CVM rather than CLB. You can determine the account type as instructed in Billing Overview.
- In this example, the values returned by the service deployed on two real servers are different. In actual scenarios, to ensure that all users have a uniform experience, generally the same service should be deployed on all real servers.
A CLB listener forwards requests by specifying protocols and ports. This document takes configuration of forwarding HTTP client requests by CLB as an example.
clb-test
and click its ID to enter its details page.HTTP:80
.80
.For more information on CLB listeners, please see CLB Listener Overview.
clb-test
and click its ID to enter its details page.rs-1
and rs-2
in the same region as the CLB instance and keep the default weight "10" for them.After creating a CLB instance, you can configure a CLB security group to isolate public network traffic. For more information, please see Configuring CLB Security Group.
After configuring a security group, you can choose to enable or disable "Allow Traffic by Default in Security Group" with different configurations as follows:
Note:
This feature is currently in beta test. To try it out, please submit a ticket for application. This feature is not supported for classic private network CLB.
For detailed directions, please see Configuring CLB Security Group.
For detailed directions, please see Configuring CLB Security Group.
http://vip:80
in a browser to test the CLB service. If a message is displayed as shown below, the request has been forwarded to the CVM instance rs-1
by CLB, and the CVM instance has properly processed the request and returned the result.rs-2
by CLB.Note:
- If session persistence is disabled and a round-robin method is used for scheduling, requests will be assigned to different real servers in sequence.
- If session persistence is enabled, or it is disabled but ip_hash scheduling is used, requests will always be assigned to the same real server.
Was this page helpful?