F5 Networks Web Services Availability
Control for BEA WebLogic Workshop
• Introducing the F5 Web Services Availability
Control for the BEA WebLogic Workshop
• Configuring the Web Services Availability Control
• Using the Web Services Availability Control
F5 Networks Web Services Availability Control for BEA WebLogic Workshop
Introducing the F5 Web Services Availability Control
for the BEA WebLogic Workshop
Deploying mission-critical Web services requires planning for scalability,
reliability, and performance to ensure the constant availability of Web
services. To help BEA® and F5 Networks® customers build Web services
that adapt to unexpected increases in usage, F5 created a Web Services
Availability Control for the BEA WebLogic Workshop™.
The Web Services Availability Control allows developers using BEA
WebLogic Workshop to write applications that utilize statistics and
functions exposed by F5’s intelligent traffic management devices. These
statistics and functions are exposed using F5’s open SOAP/XML API,
iControl™, which allows developers to write Web services that can
proactively control network resources to meet any availability or usage
demand. For more information about iControl, please visit
http://www.f5.com/f5products/iControl/.
Configuring the Web Services Availability Control
The Web Services Availability Control extracts statistics that relate to the
usage of a particular Web service. Developers can use these statistics to
determine when a Web service reaches maximum threshold and approaches
instability or poor performance. The developer can then create rules so that
when this threshold is met, the Web service instructs the BIG-IP system to
provision other WebLogic Servers running less critical applications. This
allows the BIG-IP system to distribute the increased user traffic over a wider
array of resources, thus increasing overall application availability and
performance.
The following prerequisites are required for this solution:
• The BIG-IP system must be configured with virtual servers, pools,
and/or nodes which you are using in your Web services.
• HTTPS (port 443) must be enabled on the BIG-IP system.
• The BIG-IP system must be running version 4.2 or later.
• The BEA WebLogic Server must be running version 7.0 or later.
For more information about the BIG-IP system concepts and features
discussed in this solution, please see the BIG-IP Reference Guide.
To configure the Web Services Availability Control, you must complete the
following tasks:
• Create an F5 Directory
• Download the required libraries
• Extract the contents of the wsavailability.zip file
• Edit the WebLogic Server startup script
BIG-IP® Deployment Guide 1-1
• Install the F5 certificate
After you have completed these tasks, you are ready to use the Web Services
Availability Control. The Using the Web Services Availability Control
section at the end of this deployment guide gives you more information
about the specific methods used in this control, and gives an example of how
to use one of these methods.
Create an F5 Directory
The first task you need to perform is to create a directory to store the
supporting libraries.
To create an F5 directory
1. Click the Microsoft® Windows® Start menu and select Run.
The Run dialog box opens.
2. In the Open: box, type cmd /c mkdir c:\F5, and click OK.
This command creates a directory called F5 on the C: drive of your
computer.
Download the required libraries
The next task is to download the appropriate supporting client libraries to
the F5 directory that you created in the section above. This solution requires
five supporting client libraries. The following list contains the names of the
client libraries and the location where they are available for download.
• Apache SOAP, version 2.2, found at
http://xml.apache.org/soap
• Apache Xerces-J, version 1.4.3, found at
http://xml.apache.org/xerces-j
• Sun's Java Secure Socket Extension (JSSE), version 1.0.2 found at
http://java.sun.com/products/jsse
• Sun's JavaBeans Activationwork (JAF), version 1.0.1 found at
http://java.sun.com/products/beans/glasgow/jaf.html
• F5’s wsavailability.zip file, found at
http://tech.f5.com/home/deploy/bea_workshop.html.
(You must have or register for a user name and password to access
this site).
1-2
F5 Networks Web Services Availability Control for BEA WebLogic Workshop
Extract the contents of the wsavailability.zip file
After you download the wsavailability.zip file, you need to extract the
contents to your WebLogic server. In our example, we use the Example
Server server installation that comes with the default installation of
WebLogic Server 7.0. If you are using the Example Server, the contents of
the ZIP file should be extracted to the following directory:
C:\bea\weblogic7\samples\workshop\applications
If you are planning to use the Web Services Availability Control for your
own Workshop project, extract the contents of the wsavailability.zip file to
the directory that contains the name of your project. For example:
<your Workshop Domain>\applications\<your project name>
Edit the WebLogic Server startup script
The next task is to add the appropriate environment variables to the
WebLogic Server startup script for the server installation that you wish to
use for the Workshop. In the following example, we use the Example Server
server of WebLogic Server 7.0. The startup script for this server is
startWLS.cmd.
To edit the WebLogic Server startup script
1. Open the Microsoft Start Menu and select Run from the menu.
The Run dialog box opens.
2. In the Open: box, type
cmd /c notepad c:\bea\weblogic700\server\bin\startWLS.cmd
and click OK.
The startWLS.cmd file opens in Notepad.
3. Search for the line that starts with:
set CLASSPATH=%JAVA_HOME%...
This line sets the Java version used to start the WebLogic Server.
4. Replace the entire line above with the following environmental
variables:
set
CLASSPATH=%F5_CP%;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\ser
ver\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar
;%CLASSPATH%
5. Immediately above the environmental variables you just entered in
Step 4, add the following lines:
set
F5_HOME=C:\f5
set
F5_CP=%F5_HOME%\xerces.jar;%F5_HOME%\mail.jar;%F5_HOME%\a
ctivation.jar;%F5_HOME%\soap.jar;%F5_HOME%\jcert.jar;%F5_
HOME%\jnet.jar;%F5_HOME%\jsse.jar
BIG-IP® Deployment Guide 1-3
The file should look like the following example:
set
F5_HOME=C:\f5
set
F5_CP=%F5_HOME%\xerces.jar;%F5_HOME%\mail.jar;%F5_HOME%\act
ivation.jar;%F5_HOME%\soap.jar;%F5_HOME%\jcert.jar;%F5_HOME
%\jnet.jar;%F5_HOME%\jsse.jar
set
CLASSPATH=%F5_CP%;%JAVA_HOME%\lib\tools.jar;%WL_HOME%\serve
r\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar;%CL
ASSPATH%
Figure 1.1 New Environmental variables in the WLS.cmd file
6. Save the file and exit Notepad.
The appropriate environment variables are now in the WebLogic
Server startup script.
Install the F5 certificate
The next task is to install the F5 certificate in the keystore.
Important
If you are using a BIG-IP redundant system, you must repeat this procedure
for both BIG-IP products.
To install the F5 certificate
1. From a web browser, type the IP address of the BIG-IP system to
access the Configuration utility.
The Security Alert dialog box displays.
2. Click the View Certificate button.
The Certificate box displays.
3. Click the Details tab.
4. Click the Copy to File button.
The Certificate Export Wizard opens.
5. Click the Next button.
The Export File Format screen displays.
6. Select Base-64 encoded X.509 (.CER), and then click Next.
The File to Export screen displays.
7. Click the Browse button.
The Save As dialog box displays.
8. Navigate to the c:\bea directory. In the File Name box, type a name
for the file with a .cer extension. For example, bigipcert1.cer. You
can name the file anything, but you must remember the name for use
1-4
F5 Networks Web Services Availability Control for BEA WebLogic Workshop
in Step 14. Click Save, and the name of the file with the full path
displays in the File to Export screen. Click Next.
The Completing the Certificate Export Wizard screen displays.
9. Click Finish.
A dialog box appears stating the export was successful. Click OK.
10. Click OK to exit the Certificate dialog box.
11. Click the Microsoft Windows Start menu, and select Run.
The Run dialog box opens.
12. In the Open: box, type cmd.
The command prompt opens.
13. Type the following command to change to the directory:
cd \bea\JDK131\bin
Note: The JDK131 may be different, depending on your installation.
14. Type the following command, inserting the name of the certificate,
and press Enter.
keytool -import -v -trustcacerts -alias <bigip> -file
c:\bea\<name of cert file from step 8> -keystore
.keystore
Note: The alias needs to be unique for each entry in the keystore.
15. At the Enter Keystore Password prompt, enter a password. You
are not prompted to re-enter the password, so type carefully.
Using the Web Services Availability Control
The Web Services Availability Control includes a number of different
methods for interacting with the BIG-IP product. You can use this control to
add high availability for your Web services.
If you are not familiar with the BEA WebLogic Workshop, we recommend
you use the Workshop Tutorial, available from the WebLogic Workshop
Help menu. The Workshop Tutorial provides detailed information on how to
use the WebLogic Workshop.
Note
To use the Web Services Availability control, you must make sure that you
extracted the files from the wsavailability.zip file into the current Web
Services directory. See Extract the contents of the wsavailability.zip file for
more information.
The following sections describe the methods available in the Web Services
Availability Control.
BIG-IP® Deployment Guide 1-5
Virtual server methods
The Web Services Availability Control includes the following methods to
get and set information from the virtual servers on the BIG-IP product.
Virtual servers are a specific combination of virtual address and virtual port,
associated with a content site that is managed by a BIG-IP system.
◆ getVSConnectionLimit
Gets the connection limit setting for the virtual server.
◆ setVSConnectionLimit
Allows you to restrict the number of connections for the virtual server.
◆ getVSState
Gets the current state (enable/disable) of the virtual server.
Note that this applies to whether new connections can be started; existing
connections are preserved.
◆ setVSState
Allows you to set the state for the virtual server.
◆ resetVSStats
Resets the virtual server statistics.
◆ getVSStats
Gets the bits (in/out), packets, (in/out) and current, max, and total
connections.
Pool methods
The Web Services Availability Control includes the following methods to
get information from the pools on the BIG-IP product. A pool is a set of
devices grouped together to receive traffic according to a load balancing
method.
◆ getPoolMemberList
Provides a list of the nodes in the specific pool. See the Node methods
section for information on nodes.
◆ getVSPool
Gets the pool assigned to the virtual server.
◆ addPoolMember
Adds a new member to the pool.
◆ deletePoolMember
Deletes a member from the pool.
◆ resetPoolStats
Resets the pool statistics.
◆ getPoolStats
Gets the bits (in/out), packets, (in/out) and current, max, and total
connections.
1-6
F5 Networks Web Services Availability Control for BEA WebLogic Workshop
Node methods
The Web Services Availability Control includes the following methods to
get information from the nodes on the BIG-IP product. A node is a specific
combination of an IP address and port (service) number associated with a
server in the array that is managed by the BIG-IP system.
◆ getNodeServerList
Gets the list of all the nodes on the BIG-IP system.
◆ getNodeConnectionLimit
Gets the connection limit setting for the node.
◆ setNodeConnectionLimit
Allows you to restrict the number of connections for the node.
◆ getNodeState
Gets the current state (enable/disable) of the node.
Note that this applies to whether new connections can be started; existing
connections are preserved.
◆ setNodeState
Allows you to set the state for the node.
◆ getNodeStats
Gets the bits (in/out), packets, (in/out) and current, max, and total
connections.
◆ resetNodeStats
Resets the node statistics.
Using the Widget Store example
The Web Service Availability Control contains an example Web service
called Widget Store. The Widget Store is a Web service specifically
designed for an e-commerce site. It contains several Web service methods
that demonstrate how the Web Service Availability control can provide
application traffic management using the BIG-IP system. This example is
available in the WidgetStore.jws file, included in the wsavailability.zip
file.
To open the WidgetStore.jws file within WebLogic Workshop, simply load
the project that contains the contents of the wsavailability.zip file (see
Extract the contents of the wsavailability.zip file), and click
WidgetStore.jws in the Project Tree. The screen should look similar to the
following graphic:
BIG-IP® Deployment Guide 1-7
Figure 1.2 WidgetStore.jws in the BEA WebLogic Workshop
Using the WidgetStore.jws statusOrder method
One of the methods available in the Widget Store is statusOrder. This
method guarantees that the system gives precedence to the customer’s order
over information requests. For instance, when a user submits an order, the
system ensures that there are sufficient resources to complete their
transaction. However, if a user requests the status of an order, and there are
currently too many connections, the statusOrder method returns a message
to the user informing them that order status is not available at this time.
The comments (lines starting with //) in Figure 1.3 explain what occurs in
the statusOrder method.
1-8
F5 Networks Web Services Availability Control for BEA WebLogic Workshop
/**
* @jws:operation
*/
public String statusOrder()
{
String status = "Order Status is not available at this time, Please try later";
String[][] stats = wsAvailabilityControl.getVSStats(serviceAddress);
// returns all virtual server statistics
String connections = stats[4][1];
// get current connection for virtual server
if(Long.parseLong(connections) < statusServiceLimit) {
// statusServiceLimit is defined as 10 at the top of the file
// add order status checking code or service
status = "Order has been shipped";
}
return status;
}
Figure 1.3 Example of the statusOrder operation in the WidgetStore
BIG-IP® Deployment Guide 1-9
1 - 10