3 Replies Latest reply on Feb 9, 2006 5:08 PM by rajesh.gajula

    mod_jk sticky session problem

    quiroga_juan_antonio

      Hi,

      I try to use mod_jk with sticky session for load balance and don't work, this is my environment: 1) web server apache 1.3, 2) two jboss 4.0.2, 3) mod_jk with sticy session enable, 4) stateful session with no passivation, 5) http invoker enable (redirect to apache public ip).
      The problem is : when client send the create object request (jndi, stateful session, ejbhome.create() ), this requirement is send to node1, when the same client send the method request of this session, this request is send to node2 and jboss (node2) send this exception: "Could not activate ...... .ser" this is because the session is activated in node1 and try to execute methods in node2.
      I followed the documentation to configure the environment.

      mod_jk with one node works fine.

      Thanks in advance


        • 1. Re: mod_jk sticky session problem

          Hi,
          Please make sure to set the value for sticy session value to "1", and please check if you enter the two node names for loadbalancing among them at workerproperties.conf file unser "APACHE_HOME/conf".

          Thanks ,
          Rajesh.G

          • 2. Re: mod_jk sticky session problem
            quiroga_juan_antonio

            Thanks for your reply !

            My workers.properties:

            worker.list=router

            # Define the first node.
            worker.node1.port=18009
            worker.node1.host=172.31.1.3
            worker.node1.type=ajp13
            worker.node1.lbfactor=1
            worker.node1.cachesize=10
            worker.node1.socket_keepalive=1

            # ...and the second node.
            worker.node2.port=28009
            worker.node2.host=172.31.1.4
            worker.node2.type=ajp13
            worker.node2.lbfactor=1
            worker.node2.cachesize=10
            worker.node2.socket_keepalive=1

            # Now we define the load-balancing behaviour
            worker.router.type=lb
            worker.router.balanced_workers=node1, node2
            worker.router.sticky_session=1
            worker.router.sticky_session_force=1

            In TOMCAT_1/server.xml




            In TOMCAT_2/server.xml



            I test this:

            1) Enable HTTP connector in Jboss nodes
            2) Enable Public ip for Jboss nodes
            3) In Jboss nodes changes the HTTP Invoker URL to the JBoss node Public ip

            Result:

            1) load balancing the html (apache ip)
            2) JNDI Invoker Connection estabish to http connector (jboss ip)
            3) EJB Invoker connection establish to http connector (jboss ip)

            This work, but this is a wrong environvent. All the traffic should be send trhough apache mod_jk

            • 3. Re: mod_jk sticky session problem

              Hi ,
              Here you are not using the loadbalancing concept , and the ports you can use like four digit (8109, 8209).
              you just go through this link whick will help you a lot...
              http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingMod_jk1.2WithJBoss

              thanks,
              Rajesh.G