Saturday, March 13, 2010

Clustering or LoadBalancer configuration with apache web server

install Apache HTTP Server2.2.11 web server.
Once the installation starts follow the steps as shown in following figures.






Configuration of Web server

          Configuration at Apache Http Server (Web Server)

Apache JK_MOD (Tomcat Connector).
In order to apache web server able to communicate with the Application, we need to configure Apache JK_MOD, for this purpose we need to enable the Apache module “mod_jk.so”.

Download the mod_jk_version_number.so rename it to mod_jk.so and place it under “ApacheInstallation”/modules

 

Edit apache web server configuration file “ApacheInstallation”/httpd.conf and add the below parameters:

# Include mod_jk configuration file
   Include conf/mod_jk.conf

Create a file under “ApacheInstallation”/httpd as mod_jk.conf and add the below properties into it
             
mod_jk.conf file

LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel debug
JkLogStampFormat  "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /custcare/* loadbalancer
JkShmFile logs/jk.shm
JkMount status
Order deny,allow
Deny from all
Allow from all

Create a worker.properties file under “ApacheInstallation”/httpd and add the following parameters

# Define list of workers that will be used
# for mapping requests
  worker.list=loadbalancer

# Define Node1
# modify the host as your host IP or DNS name.
  worker.node1.port=8009
  worker.node1.host=192.168.2.107
  worker.node1.type=ajp13
  worker.node1.lbfactor=1
# worker.node1.local_worker=1 (1)
# worker.node1.cachesize=10

# Define Node2
# modify the host as your host IP or DNS name.
  worker.node2.port=8009
  worker.node2.host=192.168.2.55
  worker.node2.type=ajp13
  worker.node2.lbfactor=1
# worker.node2.local_worker=1 (1)
# worker.node2.cachesize=10
# Load-balancing behavior
  worker.loadbalancer.type=lb
  worker.loadbalancer.balance_workers=node1,node2
  worker.loadbalancer.sticky_session=1
# worker.loadbalancer.local_worker_only=1
# worker.list=loadbalancer

 

Configuration on Customer care Application server Node’s  

                                       

Copy the “JbossInstallation”/server/all/deploy/tc5-cluster.sar folder into “jbossinstallation”/server/custcare/deploy/
  Copy the “JbossInstallation”/server/all/lib/jboss-cache.jar and jgroups.jar into “jbossinstallation”/server/custcare/lib   under the “jbossinstallation”/server/custcare/jbossweb-tomcat55.sar/server.xml

8009" address="${jboss.bind.address}"
emptySessionPath="true" enableLookups="false" redirectPort="8443"
protocol="AJP/1.3"/>

                 jvmRoute="node1">

Note : node1 is the system IP mapped to node in the worker.properties in the “ApacheInstallation”/httpd  

  
  under the “jbossinstallation”/server/custcare/jbossweb-tomcat55.sar/META-INF/jboss-service.xml

true

0 comments:

Post a Comment