6 Replies Latest reply on Oct 8, 2002 3:30 AM by belaban

    cluster member and javagroups

    stefus

      Hello all,
      I want to find out how many members joined to the partition.
      I try it with the fallowing code snippes:

      ---------- begin ----------------------
      String partitionName = "DefaultPartition";
      String jgProps =
      "UDP(mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=64;mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
      "PING(timeout=2000;num_initial_members=3):" +
      "MERGE2(min_interval=5000;max_interval=10000):" +
      "FD_SOCK:" +
      "VERIFY_SUSPECT(timeout=1500):" +
      "pbcast.STABLE(desired_avg_gossip=20000):" +
      "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):" +
      "UNICAST:" + //(timeout=5000;min_wait_time=2000):" +
      "FRAG(down_thread=false;up_thread=false):" +
      "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=true):" +
      "pbcast.STATE_TRANSFER";

      try
      {
      Message send_msg, recv_msg;

      Channel channel = new JChannel(jgProps);
      channel.setOpt(Channel.LOCAL, new Boolean(false));
      channel.setOpt(Channel.GET_STATE_EVENTS, new Boolean(true));
      channel.setOpt(Channel.AUTO_RECONNECT, new Boolean(true));
      channel.setOpt(Channel.AUTO_GETSTATE, new Boolean(true));

      channel.connect(partitionName);

      String nodeName = channel.getLocalAddress().toString();
      System.out.println("Nodename: " + nodeName);

      View view = channel.getView();
      Vector members = (Vector)view.getMembers().clone();
      System.out.println("Number of cluster members: " + members.size() + "(" + members + ")");

      -------------- end -------------------------------------

      One cluster node is started.
      I get this:

      -------------------------------------------------------
      GMS: address is seven:1406
      -------------------------------------------------------

      Knotenname: seven:1406

      Number of cluster members: 1([seven:1406])

      But I don't join to the group of the CluserPartition. Is there something wrong with the jgProps?

      Thanks for all replies.

      Regards
      STEFAN

        • 1. Re: MSSqlServer datasource configuration
          belaban

           

          "darranl" wrote:
          It is a while since I have looked at the initialisation of connection pools but I suspect that your connection will not be created until the first time it is actually requested.

          Your min-pol-size value will then just stop the connection pool size from dropping below 1.


          Well, that is was I was about to test. I was just wondering if the connections would only be created after the first request.

          I have to say, this behaviour could be documented.

          Now I'm going to try to get a connection and use query to verify our assertion.

          thx.
          dom

          • 2. Re: cluster member and javagroups
            slaboure

            This is a JG specific question, not related to JBoss.

            If you want to join the JB default partition cluster, make sure you use the exact same JG stack and cluster name (see the cvs code of your release for detailed info)

            • 3. Re: cluster member and javagroups
              belaban

              Hi Stefan,

              you may want to try with the org.javagroups.demos.Draw program and your properties to see whether the members find each other.

              To list the members in a partition I have added a getMembers() method to the ClusterPartition. You can see the values through jmx-console under jboss:service=DefaultPartition (http://localhost:8080/jmx-console).

              You need to checkout ClusterPartition and ClusterPartitionMBean though as this is only in the CVS.

              Bela

              • 4. Re: cluster member and javagroups
                stefus

                Hi Bela,
                I have a second problem, how can I call this method from java code? That mean how can I get the value from the method getMembers()? Do have some code snippes for me?

                Regards,
                Stefan

                • 5. Re: cluster member and javagroups
                  stefus

                  Hi Bela,
                  I have a second problem, how can I call this method from java code? That mean how can I get the value from the method getMembers()? Do have some code snippes for me?

                  Regards,
                  Stefan

                  • 6. Re: cluster member and javagroups
                    stefus

                    Hi Bela,
                    I have a second problem, how can I call this method from java code? That mean how can I get the value from the method getMembers()? Do have some code snippes for me?

                    Regards,
                    Stefan