< Home

(Optional) Configuring an HTTP Scheduling Policy

An HTTP scheduling policy determines how the firewall allocates service traffic to a server group.

Prerequisites

Context

An HTTP scheduling policy is configured based on the initial field in HTTP, which includes URL, Referer, Host, and cookie. For a field, such as URL, the real server group has different processing functions and performance in the HTTP and HTTPS server cluster. Different URLs correspond to different real server groups. Therefore, HTTP scheduling policies must be configured for the URLs to schedule the real server groups.

Procedure

  1. In the user view, run the system-view command to display the system view.
  2. Run the slb command to display the SLB view.
  3. Run the httpclass [ httpclass-id ] httpclass-name command to create an HTTP scheduling policy profile.

    In no ID is specified to create an HTTP scheduling policy, the system automatically assigns an idle ID to the HTTP scheduling policy.

    The created HTTP scheduling policy profile can be referenced during virtual service configuration.

  4. Run the {host | referer | cookie | url } pattern-string mode { prefix | suffix | exact | any } command to configure matching rules and actions.

    In an HTTPS server group, different fields, such as Host, Referer, Cookie, and URL, correspond to different functions and performance of the real server. The HTTP scheduling policy can be configured based on the field to allocate traffic to different server groups.

    Each virtual server can reference a maximum of eight HTTP scheduling policy profiles. The priority is matched according to the reference sequence. If an HTTP scheduling policy profile of high priority is matched successfully, it does not go on matching. The httpclass move command is used to adjust the matching priority of an HTTP scheduling policy profile.

  5. Run the action { group | group-name | close } command to configure an action for the scheduling policy.
  6. Run the slb httpclass commit httpclass-name command to submit the HTTP scheduling policy.

    After an HTTP scheduling policy profile is referenced by the virtual service, it takes effect only after it is submitted using the slb httpclass commit command. Otherwise, the HTTP scheduling policy profile does not take effect.

  7. Run the return command to return to the user view.

Example

# Schedule an HTTP scheduling policy in server group 1.

<sysname> system-view
[sysname] slb
[sysname-slb] httpclass 1 test
[sysname-slb-httpclass-1] host http://192.168.1.1/ mode any
[sysname-slb-httpclass-1] action group 1

Checking the Configuration

Run the display slb httpclass [ httpclass-name ] command to view the basic configuration information of an HTTP scheduling policy profile.

<sysname> display slb httpclass
Httpclass profile information(Total 1)
---------------------------------------
Httpclass name          : test
Httpclass ID            : 1
Pattern item number     : 1 
type      mode      pattern-string
host       any       http://192.168.1.1/
Httpclass action        : Dispatch new group 1
hit statistics:
    url                 : 0
    host                : 0
    refer               : 0
    cookie              : 0
----------------------------------------

Table 1 shows the description of the display slb httpclass command output.

Table 1 Description of the display slb httpclass command output

Item

Description

HTTPClass name

HTTPClass profile name. This parameter is configured using the httpclass command.

HTTPClass ID

HTTPClass profile ID. This parameter is configured using the httpclass command.

Pattern item number

Number of matching rules.

Type

Matching type. The matching types include Host, Referer, Cookie, and URL.

Mode

Matching mode. The matching modes include prefix, suffix, exact, and any matching modes.

Pattern-string

Matching string.

HTTPClass action

Action of an HTTP scheduling policy profile:
  • Group name: Implement load balancing in the specified server group.
  • Close: Close a connection.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic