JBoss 5.1.0 Clustering Steps by Step for Windows
===================================================================
1) Download Jboss 5.1.0
http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA.zip/download
Copy the directory to keep old copy of your Jboss server and
rename the copy to C:\JBOSS-5.1.0.GA_clustered
2) Copy the directory C:\JBOSS-5.1.0.GA_clustered\server\all to two other directories
C:\JBOSS-5.1.0.GA_clustered\server\ports-01
C:\JBOSS-5.1.0.GA_clustered\server\ports-02
3) Deploy the application to all nodes
C:\JBOSS-5.1.0.GA_clustered\server\ports-01\deploy\
C:\JBOSS-5.1.0.GA_clustered\server\ports-02\deploy\
4) Start the application Servers using differnt ports.
cd C:\JBOSS-5.1.0.GA_clustered\bin>
run.bat -c ports-01 -b <IpAddress> -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-01
run.bat -c ports-02 -b <IpAddress> -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-02
5) Check Each servers are running!
http://<IpAddress>:8180/
http://<IpAddress>:8280/
Then stop servers.
6) Download and Install the apache server
http://apache.osuosl.org//httpd/binaries/win32/httpd-2.2.25-win32-x86-openssl-0.9.8y.msi
7) Download the mod_jk Load balancer
https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/win32/jk-1.2.23/mod_jk-apache-2.2.4.so
8) Configure the Load Balancer server on apache Server.
a) Copy the file mod_jk-apache-2.2.4.so into folder xxx\Apache2.2\modules\
b) Create a new File with below content xxx\Apache2.2\conf\mod-jk.conf :
------------------------------------------------
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk-apache-2.2.4.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
JkMount /* loadbalancer
JkMountFile conf/uriworkermap.properties
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Location>
c) Create a new File with below content xxx\Apache2.2\conf\uriworkermap.properties :
--------------------------------------------------
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
d) Create a new File with below content xxxx\Apache2.2\conf\workers.properties :
--------------------------------------------------
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8109 # ports-01 uses this Port
worker.node1.host=<IpAddress>
worker.node1.type=ajp13
worker.node1.lbfactor=1
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8209 # ports-02 uses this Port
worker.node2.host=<IpAddress>
worker.node2.type=ajp13
worker.node2.lbfactor=1
# Load-balancing behavior
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
# Status worker for managing load balancer
worker.status.type=status
e) Include mod_jk's specific configuration at end of file in xxx\Apache2.2\conf\httpd.conf
-------------------------------------------------------
Include conf/mod-jk.conf
Start all servers
--------------------
1) Restart Apache Server. Click on Tray Icon apache Monitor -> restart.
2) cd C:\JBOSS-5.1.0.GA_clustered\bin>
run.bat -c ports-01 -b <IpAddress> -Djboss.messaging.ServerPeerID=1 -Djboss.service.binding.set=ports-01
3) run.bat -c ports-02 -b <IpAddress> -Djboss.messaging.ServerPeerID=2 -Djboss.service.binding.set=ports-02
If it Works Comment it here. Let me know your issues if any.
No comments:
Post a Comment