H3C Technologies H3C SecPath L1000-E Load Balancing Device User Manual

Page 4

Advertising
background image

Layer 4 server load balancing configuration

Step

Command

Remarks

server-farm-name

{

|

|

} [ mask mask-length ] [ prefix

prefix-length ]

{

|

|

}

min-number

max-number

lower-percentage

upper-

percentage

{

|

|

}

real-server-name

ipv4-address

ipv6-address

port-number

weight-value

priority-value

server-farm-name

Configurin

g a virtual

server

Configurin

g a real

server

Enter system view.

N/A

Create a server farm and enter server

farm view.

By default, no server farm is created.

Specify a scheduling algorithm for the

server farm.

By default, the scheduling algorithm for a server

farm is weighted round robin.

Specify the number of real servers to

participate in scheduling.

By default, the real servers with the highest

priority participate in scheduling.

Set the criteria to determine whether

the server farm is available.

By default, when a minimum of one real server

is available, the server farm is available.

Specify the fault processing method for

the server farm.

By default, the fault processing method is

.

All available connections are kept.

Configuring

a server

farm

Create a real server and enter real server view.

By default, no real server is created.

Configure an

IP address for

the real server.

Configure an IPv4 address.

Configure an IPv6 address.

By default, no IPv4 or IPv6 address is

configured for a real server.

Configure the port number for the real server.

Configure a weight for the real server.

By default, the weight of a real server is 100.

Configure a priority for the real server.

By default, the priority of a real server is 4.

Specify a server farm for the real server.

By default, a real server does not belong to

any server farms.

Create a virtual server and enter virtual

server view.

virtual-server-

name [

{

|

|

} ]

By default, no virtual server is created.

ipv4-address [ mask-length | mask ]

Configure a

VSIP for the

virtual server.

Configure an IPv4 address.
Configure an IPv6 address.

By default, no IPv4 or IPv6 address is

configured for a virtual server.

ipv6-address [ prefix-length ]

Configure the port number for the virtual server.

port-number

By default, the port number is 0 for the virtual

server of the IP, UDP, or TCP type.

Enable the virtual service feature for the

virtual server.

By default, the virtual service feature is

disabled for the virtual server.

Specify the default server farm, backup

server farm, and persistence server farm for

the virtual server.

server-farm-name [

backup-server-farm-name ] [

sticky-name ]

By default, no default server farm, backup

server farm, or persistence server farm is

specified for a virtual server, and the virtual

server does not reference any LB policies.

Specify an LB policy for the virtual server.

policy-name

By default, the port number of a real server is 0.

!

Network requirements

Server A, Server B, and Server C provide FTP services, and are in

descending order of hardware configuration.

Configure load balancing on the LB device to distribute user

requests among the servers based on their hardware

performance, and use health monitoring to monitor the

reachability of the servers.

[Sysname] real-server rs1
[Sysname-rserver-rs1] ip address 192.168.1.1
[Sysname-rserver-rs1] port 8080
[Sysname-rserver-rs1] weight 150
[Sysname-rserver-rs1] server-farm sf
[Sysname-rserver-rs1] quit

# Create real server rs2 with IPv4 address 192.168.1.2, port

8080, and weight 120, and add it to server farm sf.
[Sysname] real-server rs2
[Sysname-rserver-rs2] ip address 192.168.1.2
[Sysname-rserver-rs2] port 8080
[Sysname-rserver-rs2] weight 120
[Sysname-rserver-rs2] server-farm sf
[Sysname-rserver-rs2] quit

# Create real server rs3 with IPv4 address 192.168.1.3, port

number 8080, and weight 80, and add it to server farm sf.
[Sysname] real-server rs3
[Sysname-rserver-rs3] ip address 192.168.1.3
[Sysname-rserver-rs3] port 8080
[Sysname-rserver-rs3] weight 80
[Sysname-rserver-rs3] server-farm sf
[Sysname-rserver-rs3] quit

3. Configure a virtual server:

# Create TCP virtual server vs with VSIP 61.159.4.100, specify

its default server farm sf, and enable the virtual service function

on it.
[Sysname] virtual-server vs type tcp
[Sysname-vs-tcp-vs] virtual ip address 61.159.4.100
[Sysname-vs-tcp-vs] default server-farm sf
[Sysname-vs-tcp-vs] service enable
[Sysname-vs-tcp-vs] quit

Configuration procedures

1. Configure a server farm:

# Create ICMP-type NQA template t1.
<Sysname> system-view
[Sysname] nqa template icmp t1
[Sysname-nqatplt-icmp-t1] quit
# Create server farm sf, and specify the scheduling algorithm as
weighted round robin and health monitoring method as t1.
[Sysname] server-farm sf
[Sysname-sfarm-sf] predictor round-robin
[Sysname-sfarm-sf] probe t1
[Sysname-sfarm-sf] quit

Host

IP network

LB device

Server A
192.168.1.1:8080

VSIP

61.159.4.100

Server B
192.168.1.2:8080

Server C
192.168.1.3:8080

For more information about server load balancing and other load balancing configurations, see the configuration guides and command references for the device.

Configuration example

2. Configure real servers:

# Create real server rs1 with IPv4 address 192.168.1.1, port

number 8080, and weight 150, and add it to server farm sf.

Advertising