1 2 3 Previous Next 42 Replies Latest reply on Feb 18, 2007 5:51 PM by jjay009 Go to original post
      • 15. Re: Clustering begginner..please HELP
        sreejava

        hi

        i ve done the steps provided by wiki in both the servers. However i ve tested the cluster by killing the JBoss serving the request. And again made another request in the browser-which failed.

        Am i testing it in the right way by specifying the request as:-
        http:\\<IPaddressof dead server>\8080

        Also i could see 5 files with name mode_jk (as listed below)

        ..\native\apache-1.3\mod_jk.c
        ..\native\apache-1.3\mod_jk.dsp
        ..\native\apache-1.3\mod_jk.exp
        ..\native\apache-2.0\mod_jk.c
        ..\native\apache-2.0\mod_jk.dsp

        From these which one i should select and rename as 'mod_jk.so' to put inside the APACHE_HOME\modules folder (As explained in step #2 of jboss-wiki http://www.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss)

        if possible kindly explain me this step (step#2 of wiki) as it appears little confusing.

        thanking you

        sree

        • 16. Re: Clustering begginner..please HELP
          sreejava

          hi,

          i mean

          is it the right way to test the cluster?

          http:\\<SERVER#1>:8080\

          where <SERVER#1> is the dead node of the cluster.

          thank you

          sree

          • 17. Re: Clustering begginner..please HELP
            davewebb

            With apache in place, you_never_ go to the JBoss port again. Always go through apache. It monitors the server states and directs traffic accordingly. Apache knows server 1 is dead, so it sends all traffic to server 2. If both server 1 and server 2 are alive, it load balances reuqests between the 2 servers.

            You have this notion that a dead jboss server can do something. If the server process is dead, it is non-existent and can not do anything.
            Apache and Mod_jk do the management piece of the puzzle.

            Keep hitting the apache port and watch the requests failover to the remaining "live" server.

            • 18. Re: Clustering begginner..please HELP
              sreejava

              i m new to Apache2 and mod_jk. So can you please tel me which port i should try?

              thanking you

              sree

              • 19. Re: Clustering begginner..please HELP
                sreejava

                when i tried http:\\localhost, i got the plain text in bold letters as

                It Works


                when i tried http://localhost/web-console, (as said in jboss-wiki) i got the folowing


                Not Found
                The requested URL /web-console was not found on this server.


                thanking you..

                sree



                • 20. Re: Clustering begginner..please HELP
                  sreejava

                  hi

                  please help. I m eager to watch the failover mechanism...

                  I dont have the notion that a dead JBoss server can do any thing. But also dont know how to hit the Apache port as you said. (which port number i should give ?).

                  still i m not sure whether there is any error in setting up those configs as explained in jboss-wiki.The only way to know that is to hit the apache port. which port number ishould use.

                  Kindly help me..

                  thank you

                  sreevals

                  • 21. Re: Clustering begginner..please HELP
                    sreejava

                    hi

                    i have tried to find port number of Apache2. But i could n't see atleast one xml file in which i hoped i could find it out.

                    pleeeeeeeeeeeeeease reply

                    thank you

                    sree

                    • 22. Re: Clustering begginner..please HELP
                      davewebb

                      Apache is configured with the file $APACHE_HOME/conf/httpd.conf

                      I suggest you read up on Apache server configuration as there is very good documentation on it.

                      In that file you should have a listen port setting. Yours is obviously 80 based on your feedback. Here is where I think you have gone wrong. In the httpd.conf file you should have Virtual Hosts defined like the following code block. The bold line is the one that tells apache to forward certain requests onto JBoss.

                      <VirtualHost 192.168.1.50:80>
                       ServerAdmin webmaster@yourdomain.com
                       DocumentRoot /opt/apache/websites/yoursite
                       ServerName www.yourdomain.com
                       ErrorLog logs/error_log
                       CustomLog logs/access_log combined
                       JkMount /YourApp/* loadbalancer
                      </VirtualHost>
                      


                      The String "/YourApp/*" needs to match the ContextRoot setup in the web.xml file of your WAR. Suppose your application was available at http://www.yourdomain.com:8080/App/index.jsp, then your JkMount like would be:

                      JkMount /App/* loadbalancer
                      



                      The to see your app through Apache, goto:

                      http://www.yourdomain.com/App/index.jsp


                      Apache listening on port 80 matches the URI "/App/" and knows to forward on the request via modJk to the servers setup in your workers file.


                      • 23. Re: Clustering begginner..please HELP
                        sreejava

                        Hi,

                        i have read the Apache server configuration documentation. But still i have some doubts regarding some values of atributes of VIRTUAL HOST tag

                        I am sure about the value i have given for JkMount.

                        What should be the value of DocumentRoot that i have to specify in the httpd.conf file of Apache2\conf ?. I dont know which directory i have to specify here? The documentation says:-

                        DocumentRoot directive sets the directory from which httpd will serve files. Unless matched by a directive like Alias, the server appends the path from the requested URL to the document root to make the path to the document.(http://httpd.apache.org/docs/2.0/mod/core.html#documentroot)


                        i tried with the following;-

                        physical location of the war file (compleate and partial)
                        blank
                        deafault (/usr/local/apache/htdocs)

                        but it shows error while i tried http://155.35.20.209/TestApp as "Document Root [path i tried] does not exist."


                        IN short

                        Details of My Node1 are are

                        IP address of the machine : _._._.209
                        Name of the node : node1
                        Name of the application : TestApp.war(deployed in the farm dir)
                        Name of the welcome file :venkatesh.jsp

                        Details of tag in httpd.conf in the system _._._.209 is

                        <VirtualHost _._._.209:80>
                         ServerAdmin me@abcd.com
                         DocumentRoot <PLEASE HELP,I COULD NOT UNDERSTAND>
                         ServerName _._._.209
                        
                        JkMount /TestApp/* loadbalancer
                        </VirtualHost>


                        based on these details provided above can you please tell me,
                        1. Did i made any mistake in the VIRTUALHOST TAG

                        if yes,

                        How it should be? and what is the URL i have to type for testing the load balencing?

                        MANY MANY THANKS.........please help

                        sree



                        • 24. Re: Clustering begginner..please HELP
                          hmesha

                          From your last post, I thin you're missing the name space mapping. check your uriworkermap.properities file under $apache_home/conf that's where the mod_jk would know how to direct requests to which name space on the server for your war.

                          if you don't have an entry similar to the one below, please add it and restart the cluster:

                          # Test App
                          /TestApp=loadbalancer
                          /TestApp/*=loadbalancer

                          DocumentRoot : is the directory where the apache server serve static contents like images and what not. It is totally independent from your war. you can leave it as default value if you're just using your war to serve contents (static and dynamic). You can use it to serve the static content then change it to where those static contents exist.

                          Hope this helps.

                          Cheers

                          • 25. Re: Clustering begginner..please HELP
                            davewebb

                            Set the DocumentRoot to any valid Directory on your Machine. It wont matter since you are proxying all requests to JBoss. set it to c:\temp.

                            • 26. Re: Clustering begginner..please HELP
                              sreejava

                              when i tried http:\\_._._.209\TestApp fed up with seeing the error...

                              Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
                              
                              Please contact the server administrator, admin@--.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
                              
                              More information about this error may be available in the server error log.


                              At the same time in the error.log it could be seen that
                              [Thu Feb 15 13:01:55 2007] [error] [client 127.0.0.1] File does not exist: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/TestApp

                              In mod_jk.log it was
                              [Thu Feb 15 13:01:44 2007][21940:85272] [info] mod_jk.c (2150): Could not find a worker for worker name=loadbalancer

                              please help

                              • 27. Re: Clustering begginner..please HELP
                                davewebb

                                1) For now, create the directory C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/TestApp and add a file in there called index.html. Edit the file to look like this.

                                <html>
                                <body>
                                ModJK should not allow me to see this once configured properly.
                                </body>
                                </html>
                                


                                2) Post your workers.properties file so I can see it.

                                Dont be discouraged. You have modJK working, just not configured properly.

                                • 28. Re: Clustering begginner..please HELP
                                  sreejava



                                  Here is my workers.properties, where (_._._ represents the first 3 parts of IP address here). Exactly the same file is ther in both the Apache servers\conf.

                                  # Define list of workers that will be used
                                  # for mapping requests
                                  # The configuration directives are valid
                                  # for the mod_jk version 1.2.18 and later
                                  #
                                  worker.list=loadbalancer,status
                                  
                                  # Define Node1
                                  # modify the host as your host IP or DNS name.
                                  worker.node1.port=8009
                                  worker.node1.host=node1._._._.209
                                  worker.node1.type=ajp13
                                  worker.node1.lbfactor=1
                                  # worker.node1.connection_pool_size=10 (1)
                                  
                                  # Define Node2
                                  # modify the host as your host IP or DNS name.
                                  worker.node2.port=8009
                                  worker.node2.host= node2._._._.124
                                  worker.node2.type=ajp13
                                  worker.node2.lbfactor=1
                                  # worker.node1.connection_pool_size=10 (1)
                                  
                                  # Load-balancing behaviour
                                  worker.loadbalancer.type=lb
                                  worker.loadbalancer.balance_workers=node1,node2
                                  
                                  # Status worker for managing load balancer
                                  worker.status.type=status
                                  


                                  However i have added the following lines of code with uriworkermap.properties as per hmesha's posting

                                  # Test App
                                  /TestApp=loadbalancer
                                  /TestApp/*=loadbalancer
                                  





                                  • 29. Re: Clustering begginner..please HELP
                                    sreejava



                                    Also i ve read somewhere that JBoss should be started first before starting Apache2. I tried that also and failed