XCP APP FAILOVER CONFIGURATION FOR WEBLOGIC CLUSTER AND APACHE WEBSERVER ABSTRACT This white paper deals with the explanation of configuration of failover of xcp application session across nodes of weblogic when accessed with webserver. We are using Apache webserver and 2.2 xcp app will be deployed on two nodes of weblogic cluster 12.1.2. This whitepaper assumes that xcp application is already deployed on weblogic cluster, xcp Deployment guide which deals with explanation of configurations required to deploy xcp app on weblogic cluster. December, 2014 EMC WHITE PAPER
To learn more about how EMC products, services, and solutions can help solve your business and IT challenges, contact your local representative or authorized reseller, visit www.emc.com, or explore and compare products in the EMC Store Copyright 2014 EMC Corporation. All Rights Reserved. EMC believes the information in this publication is accurate as of its publication date. The information is subject to change without notice. The information in this publication is provided as is. EMC Corporation makes no representations or warranties of any kind with respect to the information in this publication, and specifically disclaims implied warranties of merchantability or fitness for a particular purpose. Use, copying, and distribution of any EMC software described in this publication requires an applicable software license. For the most up-to-date listing of EMC product names, see EMC Corporation Trademarks on EMC.com. Part Number H13738 2
TABLE OF CONTENTS MAIN SUMMARY... 4 AUDIENCE... 4 CONFIGURING THE WEBLOGIC SERVER... 4 WEBLOGIC-XCP FAILOVER SETUP... 5 WEBLOGIC SERVER CONFIGURATION... 6 APACHE WEBSERVER CONFIGURATION... 10 TESTING... 10 CONCLUSION... 11 3
MAIN SUMMARY EMC Documentum based product xcp is a powerful composition platform for developing custom application with maximum flexibility and minimum efforts. Customers use this xcp application to deploy on various application platforms including Weblogic. This whitepaper deals with weblogic application server platform, In a typical customer scenario, they would deploy on more than node of weblogic which are all in cluster mode. Each node will be typically on different machine to separate resource constraints. We can configure the widely used Apache webserver for this cluster, through which the users can access it. The advantage of this scenario is the application access will be load balanced across all the nodes. However the user will be connected to only one node during a session, if that node is brought down forcefully maybe due to maintenance or by accident, we need a failover mechanism to continue services through the other nodes which are up. This whitepaper assumes the cluster setup is done in weblogic, we discuss how to setup cluster for failover mechanism. AUDIENCE This white paper is intended for Customers, Partners, Tech Support Engineers. Language is basic to help understand everybody with various level of understanding. Basic understanding of weblogic should be more than enough, following steps should be enough help the failover setup. For knowing how to do weblogic cluster setup, please refer whitepaper http://www.emc.com/collateral/white-papers/h10662-deploying-wdk-application-weblogic-wp.pdf. CONFIGURING THE WEBLOGIC SERVER Ensure the WebLogic Server is installed and not running when you configure the WebLogic Server. Configure the WebLogic Server before you deploy the xcp application on it. 1. At the root of the server home directory, perform the following steps: a. Create a folder, for example, Customconf. b. Copy the dfc.properties file from the %Documentum%\Config folder on the Content Server to the Customconf folder in the application server home directory. For example, <application_server_home>\customconf c. (Optional) Create the rest-api-runtime.properties file in the <application_server_home>\customconf folder and add the following property for performance tuning of the MS SQL Server: rest.api.paged_query_template.db_hint.com.emc.documentum. rest.dfc.impl.query.folderchildrenquerytemplate= SQL_SERVER( FORCESEEK ) d. When configuring for the BAM server, create a folder, for example, bam. Extract bam.properties from /WEB- INF/classes/config/ and log4j.properties from /WEB-INF/classes/ of the bam-server.war file. Make modifications to these files and copy these files to the bam folder. 2. When configuring for the xcp application host, perform the following steps: a. Extract the bam-server.war file you downloaded and open bam-server.properties. b. Remove the comment symbol (#) from the following lines and enter values for your environment: # bam.server.host=hostname # bam.server.port=8010 # bam.server.context=bam-server If you deploy the BAM Server in a clustered environment, specify the IP address and port details of the load balancer for BAM. c. Copy the bam-server.properties file to the Customconf folder on the application server instance. For example, <application_server_home>\<server_instance>\customconf d. Create the deployment.properties file in the <application_server_home>\customconf folder and add xcp.repository.name=<repository name> to the end of the file. 4
3. In the <WebLogic domain directory>\bin\ folder, edit the setdomainenv.cmd file and perform the following steps: a. Set the classpath by adding the following line at the end of the file: set CLASSPATH=%CLASSPATH%;<application_server_home>\customConf where <application_server_home> is the home directory of WebLogic Server. b. Set the bam.properties and log4j.configuration system properties by modifying the following line: When configuring for the BAM server: -Dweblogic.home=%WLS_HOME% to set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% -Dbam.properties=<application_server_home>\bam\bam.properties -Dlog4j.configuration=<application_server_home>\bam\log4j.properties When configuring for the xcp application host: set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% to set JAVA_PROPERTIES=-Dplatform.home=%WL_HOME% -Dwls.home=%WLS_HOME% -Dweblogic.home=%WLS_HOME% -Dlog4j.configuration=<application_server_home>\log4j.properties c. Set the memory settings by adding the following lines: Memory arguments: if "%JAVA_VENDOR%"=="Sun" set WLS_MEM_ARGS_64BIT=-Xms256m -Xmx1024m set WLS_MEM_ARGS_32BIT=-Xms256m -Xmx1024m Maximum permanent size: set MEM_MAX_PERM_SIZE_64BIT=-XX:MaxPermSize=1024m set MEM_MAX_PERM_SIZE_32BIT=-XX:MaxPermSize=1024m 4. Save the setdomainenv.cmd file. 5. In the <WebLogic domain directory>\config\ folder, edit the config.xml file by adding these lines in the <security-configuration> element: <security-configuration> <enforce-valid-basic-auth-credentials> false </enforce-valid-basic-auth-credentials> </security-configuration> 6. Save the config.xml file. For a clustered environment with multiple WebLogic Servers, repeat this procedure on each WebLogic server node. WEBLOGIC-XCP FAILOVER SETUP Load balancing mechanism in about distributing the load or requests that are sent towards the cluster of nodes, the distribution method across nodes depends upon the distribution allocation algorithm which is being used. Failover mechanism is about 5
sustaining the request that is already established with a particular node. If the node goes down we will try to replicate the session in another node of the same cluster. Basic high level diagram of weblogic cluster with apache webserver would look like this- Admin Server Node 1 Node 2 Apache Webserver End User Weblogic Server Configuration Deploy the xcp application from Designer while pointing to the XMS Agent which includes the details of weblogic cluster. Once the deployment is done, the application would be deployed to both the nodes of weblogic cluster. We can verify this by looking into the deployment target of the war file in weblogic console. 6
We have verified that app is deployed to all nodes of the cluster, now we will stop both the nodes of cluster Open the weblogic console, now Goto Environments -> Servers, Open first node, go to Cluster tab. Make following changes in Replication Group and Preferred Secondary Group Field Replication Group Preferred Secondary Group Value Repgroup1 Repgroup2 7
Open the second node, in Cluster tab. Make following changes Field Value Replication Group Repgroup2 Preferred Secondary Group Repgroup1 Save Changes, made to both the nodes. The value Repgroup1 and Repgroup2 is for illustration purpose, it can be any value. 8
Stop both the nodes, delete all the contents of cache folder like tmp folder. Now after we have made changes in weblogic nodes to support failover, we need to modify the weblogic.xml which is inside the xcp app war file to support replication. We need to do this changes on both the nodes and admin server. We will modify weblogic.xml in three location, Admin server and both nodes In Admin Server machine, go under %WL_HOME%/user_projects/your_domain/servers/AdminServer/upload. Copy the war file of your application under this location to some temporary location and expand it to separate folder. Go under folder WEB-INF, open weblogic.xml. Under <session-descriptor> element of this xml, you will find two child elements <cookie-http-only> and <cookie-path>; below <cookie-path> tag line, add this line- <persistent-store-type>replicated_if_clustered</persistent-store-type> Save this file and repackage the war file, and replace the war file in the above location. In first node of the weblogic, under the location %WL_HOME%/user_projects/your_domain/servers/first_node/stage, you will find the war file of your application, replace the war file here as well. In second node of the weblogic, under the location %WL_HOME%/user_projects/your_domain/servers/second_node/stage, you will find the war file of your application, replace the war file here as well. 9
Now the original war deployed on both the nodes will be replaced by the repackaged war file. Make sure all the temp folder, cache is cleared on all nodes; as we need to make sure that the repackaged war file is exploded newly. Apache Webserver Configuration Install Apache Webserver in new machine, Edit httpd.conf file under conf folder, enable by uncommenting following modules, LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_connect_module modules/mod_proxy_connect.so Add mod_wl.so under modules folder, refer your weblogic manual, and add corresponding compatible version of.so file. Add this line in httpd.conf file, under all the above LoadModule statements LoadModule weblogic_module modules/mod_wl.so This will done so that apache webserver can interact with our weblogic server. Add this section at the end of file <IfModule mod_weblogic.c> WebLogicCluster <node1 ip>:port1,<node2 ip>:port2 </IfModule> <Location /> SetHandler weblogic-handler </Location> Restart the apache webserver, we should be now able to access the nodes individually and also through apache webserver http://<node1_ip>:<port1>/app http://<node2_ip>:<port2>/app http://<webserver_ip>:<webserver_port>/app We will able to access the weblogic nodes through webserver. This concludes webserver setup. Testing In Admin server StartWeblogic.cmd To start nodes: Node1 StartManagedWeblogic.cmd StartNodeManager.cmd <node1_name> http://<admin-server>:<port> 10
Node2 StartManagedWeblogic.cmd StartNodeManager.cmd <node2_name> http://<admin-server>:<port> Hit this URL in browser, http://<webserver_ip>:<webserver_port>/app Start accessing the application, it will be accessing through one of the nodes, you could see operation in command window if managedweblogic, stop this node To stop nodes: Node1 & Node2 Press CTRL+C, in command line in the StartManagedWeblogic.cmd window If the setup is proper, session will failover to the other node which is up, rather than creating a new session and redirecting to login page. Conclusion In conclusion, we have created a load balanced as well as failover enabled Weblogic cluster setup with Apache webserver. If you choose to use different webserver, refer the corresponding webserver guide, but the weblogic side setup should ideally remain the same. This setup is aimed to give a seamless interaction with the application from end user point-of-view. 11