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

    cluster member and javagroups

    Stefan Faist Newbie

      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