10 Replies Latest reply on Apr 17, 2009 10:18 AM by brian.stansberry

    Load balancer to wit till the jboss server started

    tosaravananm

      Hi All,

      We have a cluster group where all the servers have a service which has the security deployment policy, the user name password validation is done on this service.

      When the user tries to login when new server is in the start progress and the service was not deployed, we could not authenticate the user.

      How can i configure the load balancer to forward the method calls to the cluster node which has fully started?.

        • 1. Re: Load balancer to wit till the jboss server started
          brian.stansberry

          They try to log into what? A webapp?

          What JBoss version are you talking about?

          Generally the way to deal with this sort of thing is to have the service they want to log into depend on your security service. If you're talking about a webapp, in recent versions the web server connectors don't activate until the end of startup, so that should prevent the load balancer sending requests earlier than that.

          • 2. Re: Load balancer to wit till the jboss server started
            tosaravananm

            Login to our application(where we authenticate the user from our application), and not to the webapp(app server).

            We use the JBoss-4.2.2.GA.

            How do i configure the loadbalancer or from JBoss server to forward the calls only when the server is fully started?.

            • 3. Re: Load balancer to wit till the jboss server started
              brian.stansberry

               

              Login to our application(where we authenticate the user from our application), and not to the webapp(app server).


              I'm sorry, I don't understand. What kind of application? Servlet-based? EJB? What?

              • 4. Re: Load balancer to wit till the jboss server started
                tosaravananm

                We use EJB, and clientside interceptor proxy for load balancing..

                Can I ad a interceptor to check whether the server is full ystarted or not? and proceed only if the server is started, other wise route to other server?.

                Can this help?

                • 5. Re: Load balancer to wit till the jboss server started
                  tosaravananm

                   

                  "tosaravananm" wrote:
                  We use EJB, and clientside interceptor proxy for load balancing..

                  Can I add a interceptor to check whether the server is fully started or not? and proceed only if the server is started, other wise pass to other server?.

                  Will it work?


                  • 6. Re: Load balancer to wit till the jboss server started
                    brian.stansberry

                    So you have some other service that provides security services to the EJBs? The EJBs should express a dependency on that service (i.e. a "depends" element in jboss.xml) such that they don't deploy until the security service is ready. That will take care of your problem.

                    • 7. Re: Load balancer to wit till the jboss server started
                      tosaravananm

                      Thanks bstansberry,

                      My problem is not the order the services are deployed.

                      Calls are hitting the jboss server from client, before my service gets deployed. Because the interceptor does not have any knowledge whether the service is deployed or not. (How can i tell my interceptor to forward the calls to the server only when the service is deployed?)

                      • 8. Re: Load balancer to wit till the jboss server started
                        brian.stansberry

                        What you want can't be done with any existing code. And based on what I understand about your problem, I don't think it's the right approach anyway.

                        An EJB proxy and its interceptors will not know about a particular server (and thus won't invoke on it) if the EJB isn't deployed on that server. If the EJB depends on some other service to properly handle requests, the EJB should express a dependency on that service. With that dependency properly expressed, the EJB won't deploy until the other service is deployed, and since the EJB isn't deployed on the server yet, the client proxies won't invoke on it.

                        What is this security service? How is it deployed?

                        • 9. Re: Load balancer to wit till the jboss server started
                          tosaravananm

                          We use JAAS Authentication policy.

                          To explain the problem clearly,

                          We have a rich client developed on eclipse rcp, login to the application will be done using this rich client. And we use client side interceptor as a load balancer and RoundRobin as a load balancing policy.

                          RoundRobin load balancing algorithm will select the targets(JBoss servers) in a circular fashion.

                          We get the problem in the following sequence
                          1. Start the target1 (JBoss server1)
                          2. Login to the application (After server1 started fully)
                          3. Start the target2(JBoss server2)

                          The calls are hitting the server2 before it started fully, and the method invocation end up in a failure because the call was for the service which is to be deployed( because the server is in the process of starting and some of the services needed are not deployed yet).

                          Is there a way we can notify the load balancing algorithm(RoundRobin) to choose the target(JBoss server for invocation) which is fully started with all the services deployed(meaning that the server is fully started with the attribute change notification org.jboss.system.server.started).

                          And to discard the targets for invocation if the target is in the process of starting.

                          • 10. Re: Load balancer to wit till the jboss server started
                            brian.stansberry

                            Is there a way we can notify the load balancing algorithm(RoundRobin) to choose the target(JBoss server for invocation) which is fully started with all the services deployed(meaning that the server is fully started with the attribute change notification org.jboss.system.server.started).

                            No, the target becomes available as part of the start of the proxy factory of the service (which is part of the overall start of the service, i.e. the EJB). There's no simple hook to alter that. This design is based on the idea that the EJB shouldn't be started until the services it depends on are started.

                            I'm sorry if I'm being obtuse here, but I really don't understand what your problem is. AIUI, you have an EJB that is receiving requests before some other service is ready; the solution is to declare a dependency such that the EJB doesn't deploy until the other service is ready. (Or perhaps deploy the EJB in the deploy/deploy.last dir.)

                            If I'm not understanding your problem correctly, I suggest you send me a *simple* test application that shows the problem.