HP-UX OSRA for Web Services 2.
© Copyright 2009 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor's standard commercial license. The information contained herein is subject to change without notice.
Table of Contents About this Document..........................................................................................................7 Intended Audience.................................................................................................................................7 HP Services.............................................................................................................................................7 New and Changed Information in This Edition......................
DNS Load Balancing Configuration Example................................................................................29 Configuring named With the Virtual Server Host Name..........................................................30 Configuring the DNS Cache TTL Value.....................................................................................32 Disable the Java DNS Cache.......................................................................................................
List of Figures 1-1 1-2 3-1 3-2 3-3 4-1 4-2 4-3 4-4 4-5 4-6 4-7 HP-UX OSRA for Web Services: Apache, MySQL and Perl (AMP) and Tomcat Architecture.....14 HP-UX OSRA for Web Services: AMP and Tomcat Hardware Environment...............................14 Hardware Load Balancing.............................................................................................................27 DNS Load Balancing...........................................................................................................
List of Tables 2-1 2-2 2-3 6 HP-UX OSRA Components Information......................................................................................15 HP-UX OSRA Components Install Paths and Disk Space............................................................16 HP-UX Directory Server Installation Worksheet Template..........................................................
About this Document This document describes the architecture and components that are required to create an Open Source Reference Architecture (OSRA) Web Server. It provides an overview of the architecture and describes installation and administration tasks to create and deploy a Web Server on a system running HP-UX 11i v1 or HP-UX 11i v2. You can find the latest version of this document at the HP Technical Documentation website, at: http://docs.hp.com/en/internet.
NOTE: Starting with the HP-UX OSRA 2.0 release, HP-UX OSRA only contains components that are delivered and supported by HP, either bundled with HP-UX or available with HP subscriptions. Document Organization This document is organized into the following chapters. Chapter Description Chapter 1 This chapter provides summary information about the features and components of HP-UX OSRA 2.5.
WARNING A warning calls attention to important information that if not understood or followed results in personal. CAUTION A caution calls attention to important information that if not understood or followed results in data loss, data corruption, or damage to hardware or software. IMPORTANT This alert provides essential information to explain a concept or to complete a task. NOTE A note contains additional information to emphasize or supplement important points in the main text.
Software Consulting and Development http:// h20219.www2.hp.com/services/ cache/10148-0-0-225-121.html Provides open source consulting services. Publishing History The following table lists the publication history of this document. You can find the latest version of this document online at: http://docs.hp.com/en/internet.html#OSRA/Web%20Services Manufacturing Part Number Title Supported Operating Systems Publication Date 5992–5122 HP-UX OSRA for Web Services 2.
1 OSRA Architecture and Components HP-UX OSRA is a set of open source middleware, networking, and management software components for HP-UX that enable you to build and deploy open source based web services solutions. All HP-UX OSRA software has been selected and tested for interoperability, and is delivered and fully supported by HP. This chapter provides an overview of HP-UX OSRA and describes the components that make up the architecture.
Module Purpose mod_perl Embeds a Perl interpreter into the Apache web server, which allows other modules to be developed in Perl. mod_jk Allows Tomcat to handle Java Servlet and JSP requests while Apache httpd handles requests for static and dynamic content implemented in PHP, Perl, or Python. Application Server The application server delivers applications and web services to clients. The OSRA application server component is the Apache Tomcat application server.
industry-leading business applications, e-commerce platforms, messaging services, databases and Internet infrastructure. OVO SPIs available include those for MySQL and JBoss. Java Virtual Machine The Java Virtual Machine (JVM) products for HP-UX provide solutions to develop and deploy Java applications with the best performance on the HP-UX operating system. The Java products are also referred to as Java Standard Edition (Java SE) and Java Runtime Environment (JRE).
Figure 1-1 HP-UX OSRA for Web Services: Apache, MySQL and Perl (AMP) and Tomcat Architecture OVOSPI Agent Apache SPI Tomcat SPI MySQL SPI HTTPS Management Server: OpenView Application Server: Apache Tomcat Server Web Server:Apache HTTPD Web Server mod_ssl HTTP mod_php mod_perl mod_jk HTTPS JDBC AJP Database Server: MySQL JVM The following figure provides a basic hardware environment for HP-UX OSRA components. Figure 1-2 displays the basic hardware environment for the AMP and Tomcat components.
2 Installation, Configuration and Integration This chapter contains installation, basic configuration and integration information for some of the HP-UX OSRA components. Further configuration information can be found in each components individual documentation.
Table 2-1 HP-UX OSRA Components Information (continued) Component Delivery and Support Web Link Java Bundled Java http://www.hp.com/products1/unix/java/ ?jumpid=go/java Perl Bundled Perl http://h20293.www2.hp.com/portal/swdepot/ displayProductInfo.do?productNumber=PERL Installing and Setting Up Components The following section provides the information needed to begin basic installation and setup of the OSRA components. Install recommended operating system patches before installing components.
Apache Web Server Follow these steps to verify whether the Apache Web Server is running: 1. Open a web browser on the server. 2. Enter the following web address: http://127.0.0.1 Or http:// If the web server is running, a welcome page displays your domain name. Documentation detailing configuration and other requirements can be found here.
1. Stop the Tomcat Web Server by entering the following command: # /sbin/init.d/hpws_tomcat stop 2. 3. Edit the /opt/hpws/tomcat/conf/server.xml file to include the changes. Restart the Tomcat Web Server by entering the following command: # /sbin/init.d/hpws_tomcat start Follow these steps To start the Tomcat web server at system boot, follow these steps: 1. Open the /etc/rc.config.d/hpws_tomcatconf file. 2.
1. 2. Open the /etc/rc.config.d/sshd file. Change the entry to set start to true: SSHD_STAR=1 HP-UX Directory Server Setup The following worksheet provides a list of the information you need before you set up the HP-UX Directory Server. Before configuring the server, refer to the HP-UX Directory Server installation guide. It provides information about general HP-UX system requirements, including kernel parameter settings, patches required, and file system requirements.
Table 2-3 HP-UX Directory Server Installation Worksheet Template (continued) Information Description and Usage Notes Administration Domain The administration domain allows you to group multiple servers together logically so that you can more easily distribute server administrative tasks. The default configuration does not use administration domains. Select the default administration domain in this step.
For more information, see the Security Considerations section of the HP-UX 11iv2 Installation and Upgrade Guide, and HP-UX 11iv3 Installation and Upgrade Guide. These documents can be found at http://docs.hp.com/en/oshpux11iv2oe.html#Installing%20and%20Updating and http:// docs.hp.com/en/oshpux11iv3oe.html#Installing%20and%20Updating respectively. HP-UX IPFilter HP-UX IPFilter is an additional security feature in the Open Source Reference Architecture.
# chmod -R 0777 data # chmod -R mysql data 6. Run the configuration script by entering the following command: # ./configure There are several MySQL startup options: # /usr/local/mysql-enterprise-/bin/mysqld start # /usr/local/mysql-enterprise-/bin/mysqld_safe - safe start (restart on error, log errors).
Integrating the Web Server With LDAP Integrating LDAP with the web server is simplified by use of the built in LDAP authentication module auth_ldap. For details on how to configure auth_ldap, see the auth_ldap documentation at: http://.com/hp_docs/apache/apache.admin.guide Edit the httpd.conf file, identifying the appropriate modules as shown in the following example. Also include a separate file containing the auth_ldap directives. /opt/hpws/apache/conf/httpd.conf file: . .
3 Load Balancing and Cluster Configuration This chapter explains concepts for application server and web server integration and describes the steps required to successfully configure some of the integration options. The chapter discusses the following topics: • “Web Services Sessions” (page 25) • “Horizontal Scaling of Web and Application Servers” (page 26) Web Services Sessions A session is a series of requests to the web server and the application server originating from the same web browser.
Session Replication in Tomcat Session replication in the Tomcat server is an all-to-all replication of session state, meaning the session attributes are propagated to all cluster members all the time. This algorithm is efficient with small clusters. There are three types of session replication mechanisms in Tomcat: • Using in-memory replication with the SimpleTcpCluster (in the org.apache.catalina.cluster.tcp package) that ships with Tomcat 5 (in server/lib/catalina-cluster.jar).
Figure 3-1 Hardware Load Balancing Typically the hardware load balancer is configured with a virtual IP address. When a web client requests a web service, the load balancer translates the virtual IP address into the address of one of the application servers. The request is passed to an application server based on the translated address and based on an allocation policy.
Figure 3-2 DNS Load Balancing When compared to hardware load balancing, there are several potential shortfalls when using a DNS load balancing configuration: • The DNS named server does not consider the status of the application servers when it resolves the virtual server name. Requests can be routed to a server that is busy or is no longer available. • The DNS named server has no sticky sessions.
the name cache, but flushing the cache more frequently puts a larger load on the DNS name server as more requests are forwarded to it. Load Balancing With Apache mod_jk The Apache mod_jk module is a plug-in that handles communication between Tomcat and the HP-UX Apache-based Web server. Load balancing with mod_jk eliminates many of the limitations of DNS Round-Robin load balancing and does not require any additional hardware. Figure 3-3 illustrates load balancing with mod_jk.
Configuring named With the Virtual Server Host Name This configuration uses a DNS for the domain test.nameX.example.com. In that domain, use a virtual host name specj.test.nameX.example.com that can use one of the following addresses: 10.10.118.230, 10.10.118.231, or 10.10.118.232. Each of these three addresses is also assigned to another server. For instance, 10.10.118.230 is bound to the name hpdhl230-2.test.nameX.example.com. To configure named with the virtual host name, follow these steps: 1.
test.nameX.example.com) The following lines were left out of the database: 172.16.118.67 hptem270.nameX.example.com hptem270 (first name not in test.nameX.example.com) Creating "PTR" data (address to name mapping) for net 172.16.118 ...Creating "MX" (mail exchanger) data ... Building default named.boot file ... Building default db.cache file ... WARNING: db.cache must be filled in with the name(s) and address(es) of therootserver(s) Building default boot.cacheonly for caching only servers ... done 3.
# named -c /usr/local/domain/named.conf c. Configure the /etc/rc.config.d/namesvrs file so that the named server starts automatically when the system is started. Set the variable NAMED to 1, and the appropriate value for NAMED_ARGS as follows: NAMED=1 NAMED_ARGS="-c /usr/local/domain/named.conf" Configuring the DNS Cache TTL Value To address DNS clients caching the virtual server name, change the time-to-live (TTL) parameter value for the virtual server name in the DNS configuration file.
NOTE: Setting the TTL value to zero is not recommended because it can, cause problems with the DNS proxy servers. It is common to set the TTL to a small value, such as five minutes, because many web clients use DHCP and must react quickly to changes in their IP address allocation. After changing the TTL value, restart the named server as described in the previous section. Disable the Java DNS Cache Java 1.5 does not use the DNS TTL value you set in the zone configuration file.
4 MySQL Tools and Tips This chapter describes additional information on MySQL related configurations, products, and services. This chapter addresses the following topics: • “MySQL Performance Tuning Tips” (page 35) • “MySQL High Availability Using HP Serviceguard” (page 35) • “Backing Up MySQL Using HP Data Protector” (page 38) MySQL Performance Tuning Tips The following tuning tips can enhance MySQL performance: • Set the file system buffer size to 50% of main memory for ideal I/O performance.
Figure 4-1 Architecture of MySQL High Availability Using HP Serviceguard In an HP Serviceguard environment, MySQL must have the same configuration on all cluster nodes that are configured to run the package. The node currently running the package is called the primary node. All other nodes are called standby nodes. In the event of a failure on the primary node, the package fails over to a standby node and the database continues to function.
Shared Storage • A shared storage system is set up, such as an HP StorageWorks disc array. This shared storage is located in the /dev/sdx directory on each server. For the test example, the directory /dev/sdb is used on both servers. Set up the lock logical unit number (LUN) and logical volumes (LV) on the external shared storage using the following specifications: Cluster_Lock_LUN: DEVICE Name /dev/sdx1 Size 10MB Logical Volumes: PV Name /dev/sdx2 LV Name /dev/vg/lv VG Name /dev/vg LV Size 50.
5. Add /usr/local/bin to the PATH in hamysql.sh and hamysql.mon. Replace PATH=/bin:/usr/bin:/sbin:/usr/sbin:$SGSBIN with PATH=/bin:/usr/bin:/sbin:/usr/sbin:$SGSBIN:$PATH:/usr/local/bin 6. Configure the MySQL Serviceguard Cluster package on all target nodes with the toolkit using the following values: MySQL Cluster: PACKAGE Name MySQL_PKG Relocatable IP address 10.101.0.251 For more information about the toolkit configuration, see Using MySQL Toolkit in a ServiceGuard for Linux Cluster at http://docs.hp.
MySQL and other vendors provide data extraction tools, which capture and store the data from the database. Each storage engine in MySQL has unique characteristics that impact backup. HP Data Protector HP Data Protector manages backup and recovery from both disks and tapes. It automates high performance backup and recovery, from disk or tape over unlimited distances, to ensure 24/7 business continuity and seamless integration with HP storage hardware and management solutions.
Installing and Configuring a Database Backup Tool The following section describes how to use the HP Data Protector for testing purposes. In this example, the Data Protector Cell Manager and agent are installed separately on two different HP-UX systems. Before performing the following test, install the Data Protector 6.0 server on a HP-UX system. Use the following steps to install and configure the Data Protector 6.0 Agent: 1. 2.
Figure 4-4 Adding a Client 2 Backing Up MySQL Using HP Data Protector 41
Figure 4-5 Adding a Client 3 Backing Up Data The following procedures describe the extraction of data from the database and the integration of the database back up tool into the process. Extracting Data from the Database 1. Stop the slave replication, by entering the following command: mysql> STOP SLAVE SQL_THREAD; 2. Flush the tables to save the pending changes to disk, by entering the following command: mysql> FLUSH TABLES; 3.
NOTE: To identify the type of storage engine used for a particular table, use the following command: mysql> show table status from osradb like 'customer'; 4. Restart the slave replication thread after the database has been dumped, by entering the following command: mysql> START SLAVE SQL_THREAD; Integrating Data Protector 1. 2. Add the secondary storage, which is used to hold the backup data, as a device in Data Protector.
only on the binary log files, master.info and relay-log.info. Restoration of all data in the event of a disaster is achieved by first restoring the full data backup, and then restoring all the binary log updates, which are used to recover the database to the point of the binary log flush. Restoring Data Restore the data file and binary log files to both the master server and slave server. All database data is recreated using the extracted data file and the binary log files. 1. 2.