Using Web Sphere Edge Server to build Load Balancing for cold rolling Systems
A user's ERP system has been running for eight years. The Cold Rolling Workshop system has been running for nearly five years. Its core business system is the cold rolling Data Summary Query System, which is built based on the WAS, DB2, and Power minicomputer environment, stable Operation till now. Since the cold rolling query function has enabled the query function of interfaces of other business systems, the Data Query load has increased dramatically. Currently, the Web load is visible at the elbow, which is based on the industrial control of business systems, we tested and compared several load balancing solutions, and finally stood out in F5 and other solutions. We adopted the load balancing solution of EdgeServer. The main reasons are as follows:
1. The Server Load balancer solution of ibm was is compatible with the java session-level Server Load balancer function of WAS. Compared with the hardware F5 and open-source solutions, saves a lot of configuration risks.
2. The lowest learning and maintenance costs for WAS Administrators
3. You can make full use of sessionDB Database Configuration and perform multi-layer configuration.
4. Free! There is also support from IBM 800. Why not?
The configuration method is as follows:
The cold rolling system is based on the AIX environment and version-dependent WAS version. Contains the minor Fixpack version.
Prerequisites for installing the Load Balancer component on an AIX operating system:
·AIX version:AIX 5.1 5100-04 maintenance package or AIX 5.2 5200-01 maintenance package. Supports 32-bit or 64-Bit mode.
·Available disk space required for software and documentation:50 MB, plus additional space required for log files.
· One of the following network interface cards (NICS:
· 16 Mb card ring.
· 10 Mb Ethernet.
· 100 Mb Ethernet.
· 1 Gb Ethernet.
· Optical Fiber Distributed Data Interface (FDDI ).
· Multi-port Ethernet NIC.
·Java 2 Runtime Environment:This software is available in any version of ibm aix Developer Kit, Java 2 Technology Edition, 1.4.1.x.
System topology:
Install Edge Server (172.16.5.30 and 172.16.5.31) and log on to the WebSphere Edge Server disc as the root user. If the mount/cdrom is not set up, run: mkdir/cdrommount-v cdrfs-p-r/dev/cd0/cdrom enter/cdrom and execute. /install (if the AIX version is 5.1, bos is required. for iocp 5.1.0.11 or later versions, if the AIX version is 5.2, you must copy the disc to the hard disk directory, comment out the relevant version check section in install, and install it from the hard disk) select "Next license agreement" in the welcome window and select "Yes" to install the interface language (both Chinese and English). However, the Chinese language must be supported by the operating system Language Pack. The following uses English as an example) select Next. On the component selection page, select Administration and Dispatcher in Load Balancer. You can see that License and Runtime are selected synchronously. Click Next to view the options to be installed, and click Proceed to wait for the installation to complete, click Finish to close the window.
Web Server layer cluster configuration and Edge Server Settings
This layer cluster is mainly set on 30 and 31 machines. In this phase, we need to configure and verify that requests can be successfully distributed to Web servers 30 and 31 from the Edge Server (on the 30 or 31. (The Web server uses the plug-in for connection distribution at the same level as the backend application server. We have already verified it in the previous section.) So here we take the 30 Distribution controller as an example to describe the Configuration:
31 operations on the host
Add vi/etc/hosts:
172.16.5.30 edgesvr1
172.16.5.31 edgesvr2
172.16.5.13 wisco_sit
The next one is the cluster name and cluster address for accessing the Web server.
Configure the LoopBack Nic and delete additional routes
Ifconfig lo0 alias 172.16.5.13 netmask 255.255.255.0
Route delete 172.16.5/24 172.16.5.13
30 operations on the host
Add vi/etc/hosts:
172.16.5.30 edgesvr1
172.16.5.31 edgesvr2
172.16.5.13 wisco_sit
Issue the dsserver start command on the 30 host with Edge Server installed to start DispatchingServer (because/usr/java131 is already in the system environment path, you can directly execute it)
Run lbadmin to open the Load Balancer Configuration window.
Right-click Dispatcher and choose Connect to Host.
In the displayed dialog box, click OK in the "select host name: EDGESVR1 on port 10099" window.
Manage and configure the client window to successfully connect to Host: EDGESVR1, select Host: EDGESVR1-right-click-Start Executor
Executor: 172.16.5.30 appears. Select it, right-click Add Cluster, and enter
Cluster Wisco_sit
Cluster Address 172.16.5.13
Use the default settings and click OK.
Select Cluster: Wisco_sit and right-click "Add Port ".
Port 80
Forwarding Method maintains the default MAC settings
Click OK.
Select the Port: 80 icon and right-click Add Server.
Server EDGESVR1
Server address 172.16.5.30
Select OK
Repeat adding Server edgesvr2 (172.16.5.31)
Select Host: EDGESVR1, right-click Start Manager
Right-click the Manager that appears and choose Start Advisor.
Advisor name: HTTP
Port number: 80
Click OK.
Select Advisor: Http 80
Add an address alias (as a broadcast address) to en0)
Ifconfig en0 alias 172.16.5.13 netmask 255.255.255.0
(Optional) is the same as that of the distributor. In non-HA scenarios, to prevent address loss after the reboot host, we need to add the above command to/etc/rc.net to ensure that the command is executed every time the server is started and not configured in the test.
In the Load Balancer window, select Advisor: Http80. The server EDGESVR1 and edgesvr2 are displayed on the CurrentStatistics page on the right and the corresponding dynamic weights are displayed. (If the IBM Http Server on 30 and 31 is shut down, the corresponding value is displayed as "-1" and you need to start them separately:/usr/IBMHttpServer/bin/apachectlstart)
Finally, we need to save our settings. Select Host: EDGESVR1, right-click-SaveConfiguration File As, select default. cfg in the displayed window, and select OK.
Similarly, the same operation is performed on host 31.
Edge Server takeover settings
Take over settings of Edge Server
On host 30
Modify default. cfg
Vi/opt/ibm/edge/lb/servers/deployments/dispatcher/default. cfg
Add the following command section after the dscontrol executor start command:
Dscontrol highavailabilityheartbeat add 172.16.5.30 172.16.5.31
Dscontrol highavailabilitybackup add primary = 172.16.5.31 auto10006
Dscontrol highavailabilityreach add 172.16.5.33
Delete the following command
Dscontrol cluster add wisco_sitaddress 172.16.5.33 primaryhost 172.16.5.30
Run: wq to save and exit (when adding a recovery policy In HA, there are two modes: manual and automatic. The parameters are manual and auto respectively. If the host can run again during automatic recovery, to continue routing information packets, and manual recovery requires the use of the takeover command to forcibly route information packets back to the host. Both methods are available, but the settings must be consistent on the master and slave hosts .)
Copy and modify the script file
Go to the/opt/ibm/edge/lb/servers/bin directory and execute
Cp ../samples/go *.
Cp ../samples/high *.
In the HA environment, we need four script files: goAtive, goStandby, goInOp, and highavailChange. The modifications to these four script files seem complicated, there are only two tasks. One is to modify several important variable values and change the values in the original sample to values in your actual system (such as NETWORK, INTERFACE, NETMASK, and DESTINATION ), the second is to remove the annotation mark of some logs and relevant settings on AIX 5L to make them take effect.
To better understand the settings of these script files, their functions are described as follows:
GoAtctive: When the Dispatcher enters the active state and the route information package starts, execute the goActive script and run the Dispatcher under the HA configuration. This script deletes the return alias and adds the device alias.
GoStandby: When the Dispatcher enters the STANDBY state, the goStandby script is executed to monitor the status of the active machine, but no information packets are routed. A script required for HA configuration. It is used to delete a device alias and add a return alias.
GoInOp: Execute the goInOp script before the Dispatcher stops executing the program and the execution program starts for the first time. Run Dispatcher under High Availability Configuration. You can create this script. This script deletes all devices and return aliases
HighavailChange: The highavailChange script is executed no matter how high availability is changed in Dispatcher. You can use this script to change status information, such as recording events and even reminding administrators.
Vi goActive. sample,
Modify the settings as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
NETMASK = 0xffffff00
# For AIX 5.1 Only-uncomment and setthis value
DESTINATION = 172.16.5/24
Date> $ LB_LOGDIR/ha. log
Print "This machine is Active. Aliasing cluster address (es) to NIC \ n"> $ LB_LOGDIR/ha. log
For CLUSTER in 13; do
Ifconfig lo0 delete $ NETWORK. $ CLUSTER
Ifconfig $ INTERFACE alias $ NETWORK. $ CLUSTER netmask $ NETMASK
# For AIX 5.1 Only-uncomment thisline
# Route delete $ DESTINATION $ NETWORK. $ CLUSTER
Done
Note that in the goActive script, the route delete $ DESTINATION $ NETWORK is not deleted according to the prompt in the comment. $ CLUSTER, because no additional route 172.16.5/24 172.16.5.13 is generated when we use ifconfig to add alias to en0. You can use netstat-nr to check this check item (When configuring a single Edge Server, you should be able to see whether there is any additional route generation ). In different environments, verification is required first.
Cp goActive. sample goActive copy as an executable script
Vi goStandby. sample
Modify the settings as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
NETMASK = 0xffffff00
# For AIX 5.1 Only-uncomment and setthis value
DESTINATION = 172.16.5/24
#
Date> $ LB_LOGDIR/ha. log
Print "Going into Standby mode. \ n"> $ LB_LOGDIR/ha. log
Print "Deleting the device aliases and adding the loopbackaliases" >>$ LB_LOG
DIR/ha. log
For CLUSTER in 13; do
Ifconfig $ INTERFACE delete $ NETWORK. $ CLUSTER
Ifconfig lo0 alias $ NETWORK. $ CLUSTER netmask $ NETMASK
# For AIX 5.1 Only-uncomment thisline
Route delete $ DESTINATION $ NETWORK. $ CLUSTER
Done
Cp goStandby. sample goStandby
Vi goInOp. sample
Modify as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
#
Date> $ LB_LOGDIR/ha. log
Print "Executor has stopped. Removing loopback and device aliases. \ n" >>l L
B _LOGDIR/ha. log
For CLUSTER in 13; do
Ifconfig lo0 delete $ NETWORK. $ CLUSTER
Ifconfig $ INTERFACE delete $ NETWORK. $ CLUSTER
Done
Cp goInOp. sample goInOp
Cp highavailChange. sample highavailChange
On host 31
Modify default. cfg
Vi/opt/ibm/edge/lb/servers/deployments/dispatcher/default. cfg
Add the following command section after the dscontrol executor start command:
Dscontrol highavailabilityheartbeat add 172.16.5.31 172.16.5.30
Dscontrol highavailabilitybackup add primary = 172.16.5.30 auto10006
Dscontrol highavailabilityreach add 172.16.5.33
Delete the following command
Dscontrol cluster add wisco_sitaddress 172.16.5.33 primaryhost 172.16.5.30
Copy and modify the script file
Go to the/opt/ibm/edge/lb/servers/bin directory and execute
Cp ../samples/go *.
Cp ../samples/high *.
We need four script files: goAtive, goStandby, goInOp, and highavailChange.
Vi goActive. sample
Modify as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
NETMASK = 0xffffff00
# For AIX 5.1 Only-uncomment and setthis value
DESTINATION = 172.16.5/24
#
Date> $ LB_LOGDIR/ha. log
Print "This machine is Active. Aliasing cluster address (es) to NIC \ n"> $ LB_LOGDIR/ha. log
For CLUSTER in 13; do
Ifconfig lo0 delete $ NETWORK. $ CLUSTER
Ifconfig $ INTERFACE alias $ NETWORK. $ CLUSTER netmask $ NETMASK
# For AIX 5.1 Only-uncomment thisline
# Route delete $ DESTINATION $ NETWORK. $ CLUSTER
Done
Cp goActive. sample goActive
Vi goStandby. sample
Modify as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
NETMASK = 0xffffff00
# For AIX 5.1 Only-uncomment and setthis value
DESTINATION = 172.16.5/24
#
Date> $ LB_LOGDIR/ha. log
Print "Going into Standby mode. \ n"> $ LB_LOGDIR/ha. log
Print "Deleting the device aliases and adding the loopbackaliases"> $ LB_LOGDIR/ha. log
For CLUSTER in 13; do
Ifconfig $ INTERFACE delete $ NETWORK. $ CLUSTER
Ifconfig lo0 alias $ NETWORK. $ CLUSTER netmask $ NETMASK
# For AIX 5.1 Only-uncomment thisline
Route delete $ DESTINATION $ NETWORK. $ CLUSTER
Done
L cp goStandby. sample goStandby
U vi goInOp. sample
L modify as follows:
LB_LOGDIR =/opt/ibm/edge/lb/servers/logs/dispatcher
NETWORK = 172.16.5
INTERFACE = en0
#
Date> $ LB_LOGDIR/ha. log
Print "Executor has stopped. Removing loopback and device aliases. \ n"> $ LB_LOGDIR/ha. log
For CLUSTER in 13; do
Ifconfig lo0 delete $ NETWORK. $ CLUSTER
Ifconfig $ INTERFACE delete $ NETWORK. $ CLUSTER
Done
Cp goInOp. sample goInOp
Cp highavailChange. sample highavailChange
Run dsserver start on 30 and 31 respectively to start the Edge Server service.
Verify that Edge Server HA takes over
It is relatively simple to verify that the HA of Edge Server takes over. You only need to stop the process during the Primary Edge Server route information package (or even unplug the network cable or power off the power supply, etc, however, it may be difficult to implement the test, so it is not used in this test .), Make sure that you can still access the corresponding content through the cluster address or host name to verify the content. In the specific test, we send an http: // 172.16.5.13request in the client browser to return to the index.html page. Run the dsserver stop command on host 30 (or Kill the corresponding process). At this time, the distributor on host 30 is no longer working. Open a new browser window (the Anti-termination feature is slow and the HTTP request is sent again. As you can see, index.html is returned normally, that is, the distribution task is automatically transferred to the original backup Dispatcher.
L if the recovery policy is automatic, run dsserver start on the 30 Host, and the information package is automatically routed back to 30Dispatcher. Run lbadmin to open the LB Management Configuration window and connect to Host: edgesvr1. We can see that Executor is 30, and then check the number of connections in the Cluster server: edgesvr1 and server: edgesvr1 respectively, and record them. Open the browser on the client, access http: // 172.16.5.13, and refresh the page. You can see that the number of connections in edgesvr1 or edgesvr2 has increased by 1. In the LB window, you can also see the current state of Executor.