10 Replies Latest reply on Apr 3, 2009 10:29 AM by timfox

    Need facilities to run clustered examples

    gaohoward

      So far we don't touch clustered examples, I had a try of clustered queue, but it seems too much for me to start with. :)

      First issue i'm facing is start two clustered nodes:

      I created two configuration files (xxx-beans.xml) and try to start to servers, but I got failure on startup the second one, It all because the JNDI port issue. But this is not correct in the first place after I asked Andy. We should use HA-JNDI service.

      But in JBM 2.0 do we have this service? or we have a different technique?

      Also I can see in xx-configuration.xml the 'Clustered' property need to be set true. Is it enough to get a simplest cluster working? I haven't reached this stage because the JNDI issue.

        • 1. Re: Need facilities to run clustered examples
          timfox

           

          "gaohoward" wrote:
          S

          But in JBM 2.0 do we have this service? or we have a different technique?



          JNDI is a service independent of JBM 2.0

          • 2. Re: Need facilities to run clustered examples
            gaohoward

            Thanks Tim, I'll take a look at JNDI project.

            • 3. Re: Need facilities to run clustered examples
              timfox

              If you explain what you're trying to achieve a bit more, maybe I can help more.

              • 4. Re: Need facilities to run clustered examples
                gaohoward

                I'm trying to build a simple clustered queue example. My plan is:

                1. Start two JBM clustered nodes.
                2. Deploy one distributed queue
                3. In the example code, create connection to the cluster using jndi, then send and receive a message from the queue. Also I want to show that the connection creation is round-robin between the two nodes. (like in 1.4)

                In 1.4 we start two nodes with their own JNDI ports and the example just use one JNDI port on one node, I follow this first but I can't make the ports setting for each node work.

                • 5. Re: Need facilities to run clustered examples
                  ataylor

                  Howard, Ive updated your config so you can now start 2 servers, take a look to see h ow I've done it. Ive commented out the clustering config in the second config file for now, I'll leave this for you to do.

                  If you explain what you're trying to achieve a bit more, maybe I can help more.


                  I think what Howard is talking about is how we curently use jndi at the moment. We start the naming bean via the mc and then lookup localhost:1099 etc. With HA jndi tho it will round robin requests to the different servers, the question is, to we need to support this standalone and if not, how does Howard deal with this in the example.

                  • 6. Re: Need facilities to run clustered examples
                    timfox

                    I'm assuming you want to create a clustered *JMS* example, not clustered core.

                    In JBM 2.0 you don't need JNDI.

                    You can create connection factories directly on the client side. You can specify the UDP group address of the cluster for discovery and it will automatically connect without having to know the addresses of each server.

                    If you don't want to create your connection factory directly, you can look up the connection factory via JNDI from a particular server.

                    If you don't know all the JNDI server addresses on the client, you could use HA-JNDI on the server (which also uses its own discovery mechanism).

                    However, so far, the standalone server doesn't start an HA-JNDI service, we would need to add it. (This would probably be useful).

                    We should probably create different clustered examples showing both techniques:

                    1) Instantiating connection factory directly

                    2) Using HAJNDI

                    • 7. Re: Need facilities to run clustered examples
                      gaohoward

                      Thanks Andy, I'll take a look.

                      • 8. Re: Need facilities to run clustered examples
                        gaohoward

                        Thanks Tim, +1 we need to show both, that's better. Let me have a look how to add HA-JNDI first.

                        • 9. Re: Need facilities to run clustered examples
                          gaohoward

                          As discussed, we can use JNDI on one node or not to use JNDI at all. So the simple solution so far is to use JNDI.

                          I got two server started now.

                          • 10. Re: Need facilities to run clustered examples
                            timfox

                            I'd say using JNDI is more complex.

                            With JNDI you need to get initial context, lookup object etc.

                            Without JNDI you just instantiate the object directly.