After you create an intelligent routing listener for a Global Accelerator (GA) instance, the GA instance automatically selects a nearby and healthy endpoint group and forwards client requests to the optimal endpoint in the endpoint group. This topic describes how to add and manage intelligent routing listeners.

Prerequisites

Add a TCP or UDP listener

  1. Configure the listener and protocol.
    1. Log on to the GA console.
    2. On the Instances page, find the GA instance that you want to manage and click Configure Listeners in the Actions column.
    3. On the Listeners tab, click Add Listener.
      Note If this is the first time that you add a listener or if the specified GA instance is not configured with a listener, skip this step.
    4. On the Configure Listener & Protocol wizard page, configure parameters described in the following table and click Next.
      Parameter Description
      Listener Name Enter a name for the listener.
      Routing Type Select the route type. In this topic, Intelligent Routing is selected.
      • Intelligent Routing: automatically selects a nearby and healthy endpoint group based on network latency and forwards client requests to the optimal endpoint in the endpoint group.
      • Custom Routing: generates a port mapping table based on the listener port range, the port ranges of the destination endpoint groups, and the IP addresses of endpoints (vSwitches). This way, traffic is routed to the specific IP addresses and ports of specified vSwitches. For more information about how to configure a custom routing listener, see Add and manage custom routing listeners.
        Note Custom routing listeners are in invitational prereview. To use custom routing listeners, submit a ticket.
      Protocol Select a network transmission protocol for the listener. Valid values:
      • TCP
        • A connection-oriented protocol that provides high reliability. A logical connection must be established before data can be transmitted.
        • Session persistence is based on source IP addresses.
        • Source IP addresses are visible at the network layer.
        • Data is transmitted at a slow rate.
      • UDP
        • A connectionless and unreliable protocol. Three-way handshakes are not required before UDP packets are transmitted. UDP does not provide error recovery or data retransmission.
        • Data is transmitted at a high rate.
      Port Number Specify the listener port. The listener port is used to receive requests and forward requests to endpoints. Valid values: 1 to 65499.

      You can specify up to 30 listener ports for each listener. Separate multiple listener ports with commas (,). Example: 80,90,8080.

      If you want to specify a port range, you can use a tilde (~). Example: 80~85.

      Note
      • If you add listeners that use the same protocol to a GA instance, you must configure different ports for the listeners.
      • You can specify more than 300 consecutive listener ports for a listener in specific regions. For more information, see Advanced listeners.
      Client Affinity Specify whether to enable client affinity.
      • If you select Source IP Address from the drop-down list, client affinity is enabled. After client affinity is enabled, requests from a specific client IP address are forwarded to the same endpoint.
      • If you select Disabled from the drop-down list, client affinity is disabled. After client affinity is disabled, requests from a specific client IP address may be forwarded to different endpoints.
  2. Configure endpoints.
    Each listener is associated with an endpoint group. You can associate an endpoint group with a listener by specifying the region to which you want to distribute network traffic. After you associate an endpoint group with a listener, traffic is distributed to the optimal endpoint in the associated endpoint group.

    On the Configure Endpoint Group wizard page, configure parameters described in the following table and click Next.

    This topic describes only how to configure endpoints and endpoint groups. For information about health checks, see Create a default endpoint group. For more information about endpoint groups and endpoints, see Overview.

    Parameter Description
    Endpoint Group Name Enter a name for the endpoint group.
    Region Select the region where you want to deploy the endpoint group.
    Traffic Distribution Ratio Set the traffic distribution ratio for the endpoint group. Unit: %.

    Valid values: 0 to 100.

    Note You can set Traffic Distribution Ratio only when you create an endpoint group for a TCP or UDP listener. For more information about how to set traffic distribution ratios, see Distribute traffic across endpoint groups in different scenarios.
    Backend Service Specify whether backend servers are deployed on Alibaba Cloud.
    • Alibaba Cloud: Backend servers are deployed on Alibaba Cloud.
    • Off Alibaba Cloud: Backend servers are not deployed on Alibaba Cloud.
    Preserve Client IP Specify whether to reserve client IP addresses.

    After you enable this feature, backend servers can retrieve client IP addresses. For more information, see Preserve client IP addresses.

    Endpoint Endpoints are destinations of client requests. To add an endpoint, configure the following parameters:
    • Backend Service Type: If your backend service is deployed on Alibaba Cloud, you can select Alibaba Cloud Public IP Address, ECS, CLB, ALB, or OSS. If your backend service is not deployed on Alibaba Cloud, you can select Custom IP Address or Custom Domain Name.
      Note
      • You cannot specify ECS instances in VPCs, internal-facing CLB instances, and internal-facing ALB instances as endpoints for standard GA instances. If you want to specify them as endpoints, submit a ticket.
      • The IP addresses of endpoints associated with each GA instance must be globally unique and cannot be duplicates of other GA instances.
      • If no service-linked role exists when you specify Elastic Compute Service (ECS) instances, Classic Load Balancer (CLB) instances, Application Load Balancer (ALB) instances, or Object Storage Service (OSS) buckets as endpoints, the system automatically creates the corresponding service-linked role. For more information, see AliyunServiceRoleForGaVpcEndpoint, AliyunServiceRoleForGaAlb, and AliyunServiceRoleForGaOss.
    • Backend Service: Enter the IP address, domain name, or instance ID of the backend server.
    • Weight: Set a weight for the endpoint. Valid values: 0 to 255. GA distributes network traffic to endpoints based on their weights.
      Important If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.

    You can click + Add Endpoint to add more endpoints. You can create at most four endpoints in each endpoint group. If you want to add more endpoints, go to the Quota Management page and increase the quota. For more information, see Manage quotas.

  3. Confirm the configurations.
    On the Confirm wizard page, confirm the configurations of the listener and endpoints, and then click Submit.

    If you want to modify a specific setting, click Modify in the corresponding section. Then, you are redirected to the configuration page.

    Note If this is the first time you add a listener, the listener takes effect after 3 minutes. If you modify the configurations of a listener, the new configurations take effect after 1 minute.

Add an HTTP or HTTPS listener

  1. Configure the listener and protocol.
    1. Log on to the GA console.
    2. On the Instances page, find the GA instance that you want to manage and click Configure Listeners in the Actions column.
    3. On the Listeners tab, click Add Listener.
      Note If this is the first time that you add a listener or if the specified GA instance is not configured with a listener, skip this step.
    4. On the Configure Listener & Protocol wizard page, configure parameters described in the following table and click Next.
      Parameter Description
      Listener Name Enter a name for the listener.
      Routing Type Select the route type. In this topic, Intelligent Routing is selected.
      • Intelligent Routing: automatically selects a nearby and healthy endpoint group based on network latency and forwards client requests to the optimal endpoint in the endpoint group.
      • Custom Routing: generates a port mapping table based on the listener port range, the port ranges of the destination endpoint groups, and the IP addresses of endpoints (vSwitches). This way, traffic is routed to the specific IP addresses and ports of specified vSwitches. For more information about how to configure a custom routing listener, see Add and manage custom routing listeners.
        Note Custom routing listeners are in invitational prereview. To use custom routing listeners, submit a ticket.
      Protocol Select a network transmission protocol for the listener. Valid values:
      • HTTPS: HTTPS has the following features:
        • A connection-oriented protocol that provides high reliability. A logical connection must be established before data can be transmitted.
        • You can bind SSL certificates to servers. This ensures the high reliability of data.
        • Data transmission is encrypted.
      • HTTP: HTTP has the following features:
        • A connection-oriented protocol that provides high reliability. A logical connection must be established before data can be transmitted.
        • Data is transmitted at a high rate.
        • Data transmission is not encrypted.
      Port Number Specify the listener port. The listener port is used to receive requests and forward requests to endpoints. Valid values: 1 to 65499.

      You can configure only one listener port for each HTTP or HTTPS listener.

      Client Affinity Specify whether to enable client affinity.
      • If you select Source IP Address from the drop-down list, client affinity is enabled. After client affinity is enabled, requests from a specific client IP address are forwarded to the same endpoint.
      • If you select Disabled from the drop-down list, client affinity is disabled. After client affinity is disabled, requests from a specific client IP address may be forwarded to different endpoints.
      Advanced Settings Click Modify and select a value for Add HTTP Header Field.
      • Use the GA-ID header to retrieve the ID of the GA instance.
      • Use the GA-AP header to retrieve the acceleration region of the GA instance.
      • Use the GA-X-Forwarded-Proto header to retrieve the listener protocol of the GA instance.
      • Use the GA-X-Forwarded-Port header to retrieve the listener port of the GA instance.
      • Use the X-Real-IP header to retrieve client IP addresses.
  2. Optional. Configure the SSL certificate.
    You are required to configure an SSL certificate only when you add an HTTPS listener. SSL certificates ensure that data transmission over GA is encrypted.
    1. On the Configure SSL Certificate wizard page, select the SSL certificate that you have purchased.
    2. Click Modify to the right of Advanced Settings and select a TLS security policy from the TLS Security Policies drop-down list.
      For more information about TLS security policies, see TLS security policies.
    3. Click Next.
  3. Configure endpoints.
    Each listener is associated with an endpoint group. You can associate an endpoint group with a listener by specifying the region to which you want to distribute network traffic. After you associate an endpoint group with a listener, traffic is distributed to the optimal endpoint in the associated endpoint group.

    On the Configure Endpoint Group wizard page, configure parameters described in the following table and click Next.

    This topic describes only how to configure endpoints and endpoint groups. For information about health checks, see Create a default endpoint group. For more information about endpoint groups and endpoints, see Overview.

    Parameter Description
    Endpoint Group Name Enter a name for the endpoint group.
    Region Select the region where you want to deploy the endpoint group.
    Backend Service Specify whether backend servers are deployed on Alibaba Cloud.
    • Alibaba Cloud: Backend servers are deployed on Alibaba Cloud.
    • Off Alibaba Cloud: Backend servers are not deployed on Alibaba Cloud.
    Preserve Client IP Specify whether to preserve client IP addresses.

    By default, client IP address preservation is enabled for HTTP and HTTPS listeners. GA preserves the IP address of a client in the X-Forwarded-For HTTP header. For more information, see Preserve client IP addresses.

    Endpoint Endpoints are destinations of client requests. To add an endpoint, configure the following parameters:
    • Backend Service Type: If your backend service is deployed on Alibaba Cloud, you can select Alibaba Cloud Public IP Address, ECS, CLB, ALB, or OSS. If your backend service is not deployed on Alibaba Cloud, you can select Custom IP Address or Custom Domain Name.
      Note
      • You cannot specify ECS instances in VPCs, internal-facing CLB instances, and internal-facing ALB instances as endpoints for standard GA instances. If you want to specify them as endpoints, submit a ticket.
      • The IP addresses of endpoints associated with each GA instance must be globally unique and cannot be duplicates of other GA instances.
      • If no service-linked role exists when you specify Elastic Compute Service (ECS) instances, Classic Load Balancer (CLB) instances, Application Load Balancer (ALB) instances, or Object Storage Service (OSS) buckets as endpoints, the system automatically creates the corresponding service-linked role. For more information, see AliyunServiceRoleForGaVpcEndpoint, AliyunServiceRoleForGaAlb, and AliyunServiceRoleForGaOss.
    • Backend Service: Enter the IP address, domain name, or instance ID of the backend server.
    • Weight: Set a weight for the endpoint. Valid values: 0 to 255. GA distributes network traffic to endpoints based on their weights.
      Important If the weight of an endpoint is set to 0, GA stops distributing network traffic to the endpoint. Proceed with caution.

    You can click + Add Endpoint to add more endpoints. You can create up to four endpoints for each endpoint group.

    Backend Service Protocol Select the protocol that the backend server uses. Valid values:
    • HTTP: This is the default value.
    • HTTPS
    Note
    • If the listener protocol is HTTP, this parameter is set to HTTP by default and cannot be modified.
    • You can set Backend Service Protocol only when you configure an endpoint group for an HTTP or HTTPS listener.
    Port Mapping If the listener port and the port that the endpoint uses to provide services are not the same, you must add a mapping between the ports.
    • Listener Port: Enter the listener port.
    • Endpoint Port: Enter the port that the endpoint uses to provide services.

    If the listener port and the port that the endpoint uses to provide services are the same, you do not need to add the port mapping. GA automatically distributes client requests to the listener port of the endpoint.

    Note You can set Port Mapping only when you configure an endpoint group for an HTTP or HTTPS listener.
  4. Confirm the configurations.
    On the Confirm wizard page, confirm the configurations of the listener and endpoints, and then click Submit.

    If you want to modify a specific setting, click Modify in the corresponding section. Then, you are redirected to the configuration page.

    Note If this is the first time you add a listener, the listener takes effect after 3 minutes. If you modify the configurations of a listener, the new configurations take effect after 1 minute.

Related operations

Operation Description
Modify a listener You can modify a listener to meet your business requirements. The configurations that you can modify include the basic settings, protocol, SSL certificate, and endpoint group of the listener. The routing type of a listener cannot be modified.
  1. On the Listeners tab, find the listener that you want to modify and click Modify in the Actions column.
  2. On the Edit Listener page, modify the basic settings, protocol, SSL certificate, or endpoint group of the listener and then click Next.

    For more information about the basic settings, protocol, SSL certificate, and endpoint group of a listener, see Add a TCP or UDP listener or Add an HTTP or HTTPS listener.

Delete a listener You can delete a listener. After a listener is deleted, the endpoint group that is associated with the listener is also deleted.
  1. On the Listeners tab, find the listener that you want to delete and click Delete in the Actions column.
  2. In the Delete Listener message, click OK.
Configure virtual endpoint groups and forwarding rules for an HTTP or HTTPS listener After you add an HTTP or HTTPS listener, you can configure virtual endpoint groups and forwarding rules for the listener. Then, GA can simultaneously accelerate multiple domain names or paths to access your backend HTTP or HTTPS services. For more information, see the following topics:

References

  • CreateListener: You can call this API operation to create a listener for a GA instance.
  • UpdateListener: You can call this API operation to modify a specified listener of a GA instance.
  • DeleteListener: You can call this API operation to delete a specified listener of a GA instance.