How I can cluster Jboss servers to Single IP
mohsinkamal84 Apr 12, 2011 5:04 AMHello,
Hope every one is fine.I'm new to Jboss App and unable to setup a cluster.
What is scanario:
-------------------------
I have 2 web servers
Web1 192.168.1.20
Web2 192.168.1.21
I have installed apache on it ,enabled mod_jk.
I also have created uriworkermap.properties , mod-jk.conf , workers.properties @ location /etc/httpd/conf
I have configured workers.properties and set Jboss servers IP.
My Jboss server 1 IP is 192.168.1.30 Jboss2 is 192.168.1.31 , I have defined these IPs on workers.properties on both web servers.
I'm running Jboss server with following command:
sh ./run.sh -c all -b 192.168.1.30 -Djboss.messaging.ServerPeerID=1
Jboss2
sh ./run.sh -c all -b 192.168.1.31 -Djboss.messaging.ServerPeerID=2
My Jboss server is running fine.
===> Then I have placed test pages on both servers.
--------------------
[root@webserver2 html]# pwd
/var/www/html
[root@web2 html]# cat index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=http://192.168.1.31:8080/"></HEAD>
<BODY>
</BODY>
</HTML>
~
[root@webserver2 html]#
--------------------
On webserver1
[root@web2 html]# pwd
/var/www/html
[root@web2 html]# cat index.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Your Page Title</title>
<meta http-equiv="REFRESH" content="0;url=http://192.168.1.30:8080/"></HEAD>
<BODY>
</BODY>
</HTML>
~
[root@web2 html]#
--------------------
When I access webserver IPs , my requests are forwading to Jboss servers fine and showing JBoss page.
When I access 192.168.1.20 in browser its showing page through IP http://192.168.1.30:8080 and
192.168.1.21 in browser its showing page through IP http://192.168.1.31:8080
Till now I think every thing is fine.
*********************Imp********************
What I want now is to use another IP and setup it as cluster , let say I want to setup an IP 192.168.1.40 and want to bound other two Ips to this so every time when request come from any web browser it shows results from IP http://192.168.1.40:8080 instead of Jboss servers IP.
Mean either page is serverd by Jboss 1 or @ it shows result through .40.
---------------------------------------------------------------------------
What we need to do , Can some one please provide exact steps.I'm stucked on this and servered alot but couldn't understand that how I can I achive this.