5 Replies Latest reply on Jan 13, 2014 8:16 AM by Wolf-Dieter Fink

    I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover

    asifas ali Newbie

      I have created vertical cluster with server1 and server2, both servers are start as following command

      ./run.sh -c server1 -g DocsPartition -u 239.255.100.100 -b 192.168.0.101 -Djboss.service.binding.set=ports-01 -Djboss.messaging.ServerPeerID=1 

      ./run.sh -c server2 -g DocsPartition -u 239.255.100.100 -b 192.168.0.101 -Djboss.service.binding.set=ports-02 -Djboss.messaging.ServerPeerID=2

      After successful runing servers, I have installed HellowWorld application on both server and also application is running stage and showing indexpage,

      http://192.168.0.101:8180/HellowWorld

      http://192.168.0.101:8280/HellowWorld

      but i am using different ports 8180 and 8280 for both server ! I wish to use as a cluster and use a single port for both, if server1 will failed then customer request goes to server2, i am using mod_jk connector for load-balancing, I have also try to use http://192.168.0.101:8009/HellowWorld but its not worked



      Any buddy help me regard this matter plz ? 

        • 1. Re: I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover
          Wolf-Dieter Fink Master

          If you use http you need to have a loadbalancer in front of JBoss, i.e. Apache which manage the loadbalancing. JBoss only manage the session replication.

          • 2. Re: I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover
            asifas ali Newbie

            I already used httpd in front of JBoss, can you tell me which port use for both server ?

            • 3. Re: I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover
              Wolf-Dieter Fink Master

              In that case you have to use the address from the httpd in front and configure mod_jk with the correct addresses of each JBoss instance

              • 4. Re: I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover
                asifas ali Newbie

                I configured mod_jk and tell to mod_jk file about worker.properties file location with details server, I mention port 8009 in worker.properties, I copied past bellow configuration file and let me know if I am going wrong plz.

                1.worker.properties

                #for mapping requests

                worker.list=loadbalancer,status

                 

                 

                # Define rcyber2

                # modify the host as your host IP or DNS name.

                worker.rcyber1.port=8009

                worker.rcyber1.host=192.168.48.35

                worker.rcyber1.type=ajp13

                worker.rcyber1.lbfactor=1

                worker.rcyber1.cachesize=10

                 

                 

                # Define rcyber2

                # modify the host as your host IP or DNS name.

                worker.rcyber2.port=8009

                worker.rcyber2.host= 192.168.48.36

                worker.rcyber2.type=ajp13

                worker.rcyber2.lbfactor=1

                worker.rcyber2.cachesize=10

                 

                 

                #Load-balancing behaviour

                worker.loadbalancer.type=lb

                worker.loadbalancer.balance_workers=rcyber1,rcyber2

                worker.loadbalancer.sticky_session=1

                 

                 

                #worker.list=loadbalancer

                2.

                 

                 

                #load mod_jk module

                # Specify the filename of the mod_jk lib

                LoadModule jk_module modules/mod_jk.so

                 

                 

                # Where to find workers.properties

                JkWorkersFile /etc/httpd/conf/worker.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

                 

                 

                # We can use external file for mount points.

                # It will be checked for updates each 60 seconds.

                # The format of the file is: /url=worker

                # /examples/*=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 192.168.48.35

                   Allow from 10.0.0.10

                </Location>

                 

                 

                 

                 

                #status worker for managing load balancer

                worker.status.type=status

                 

                3.uriworkermap.properties

                imple worker configuration file

                # Mount the Servlet context to the ajp13 worker

                 

                 

                /jmx-console=loadbalancer

                /jmx-console/*=loadbalancer

                /web-console=loadbalancer

                /web-console/*=loadbalancer

                 

                and also define mod_jk in this

                4th file httpd.conf

                #Include mod_jk's specific configuration file

                Include conf/mod_jk.conf

                 

                these files located on /etc/httpd/conf/

                 

                plz help me how should we access the application which use a cluster, http://ip:8009/applicaton ?

                • 5. Re: I am Setting up a JBoss EAP 5 cluster with Apache mod_jk for load balancing and failover
                  Wolf-Dieter Fink Master

                  From what I understand you try to connect the 8009 port which is the AJP port from the first JBoss instance.

                  What you need to do is to connect to apache, I think this will be the port 80 as you install all at the same machine.

                   

                  Sorry apache configuration is outside of my domain