2 Replies Latest reply on May 24, 2012 9:15 AM by mohd.masiuddin

    Load balacing with ip address in slave hosts file

    mohd.masiuddin

      Hi team,

      We are facing issue setting up host file for linux.
      We are running 2 jboss servers as master(ip1) & slave(ip2) in cluster mode.
      At this point everything seems to be working fine in load balancing mode.
      This is how our hosts files of look :
      Master Hosts:
      <ip1> localhost localhost.localdomain localhost4 localhost4.localdomain4
      127.0.0.1 <ip1>

      Slave Hosts :
      127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4


      The moment we add ip2 entry in slave host file, http can not redirect to slave.
      Only master will receive the request & slave becomes ideal. even if master is down, request will not be directed to slave.

      Could you suggest on how we can configure the slave host file with slave ip address.

      Is there any change to be done at jboss side for the same.

       

      Regards,

        • 1. Re: Load balacing with ip address in slave hosts file
          nevenc

          Hey Masluddin,

           

          Can you clarify few things here:

           

          1) Are you running this setup on two different machines (server boxes)?

          2) IP addresses that you quoted, is that from /etc/hosts file?

          3) How do you bind IPs to the JBoss JVM processes, i.e. what is port 8080 bound to (e.g. netstat -vatpn | grep 8080)?

          4) How did you setup HTTPD to point to JBoss JVM instances, e.g. mod_cluster, mod_jk?

           

          That will give us some more details to troubleshoot your problem.

           

          Cheers!

          • 2. Re: Load balacing with ip address in slave hosts file
            mohd.masiuddin

            Hi,

             

            1) Are you running this setup on two different machines (server boxes)?

            Its running on two different virtual machines (Hosted on same server). Master &  Slave.

            2) IP addresses that you quoted, is that from /etc/hosts file?

            IP address was setup by using network connection settings. We are trying to use the same ip address in /etc/hosts file for reference.

            In /etc/hosts file default ip exists as 127.0.0.1

             

            3) How do you bind IPs to the JBoss JVM processes, i.e. what is port 8080 bound to (e.g. netstat -vatpn | grep 8080)?

            tcp        0      0 masterip:8080            0.0.0.0:*                   LISTEN      1593/java

             

             

            We are running jobs on 8330… so for 8330 this is the output.

            [root@localhost ~]# netstat -vatpn | grep 8330

            tcp        0      0 masterip:8330            0.0.0.0:*                   LISTEN      1613/java

            tcp        0      0 masterip:8330            slaveip:48439           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48410           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48440           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48442           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48426           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48319           FIN_WAIT2   -

            tcp        0      0 masterip:8330            slaveip:48399           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48454           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48370           FIN_WAIT2   -

            tcp        0      0 masterip:8330            slaveip:48453           ESTABLISHED 1613/java

            tcp        0      0 masterip:8330            slaveip:48334           FIN_WAIT2   -

             

            4) How did you setup HTTPD to point to JBoss JVM instances, e.g. mod_cluster, mod_jk?

            We setup httpd on master server.

             

            We followed steps from : https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto to setup master & slave server.

             

            Thanks & Regards,