[Javagroups-development] Re: unable to create group across WAN
Brought to you by:
belaban
From: Ben M. <ben...@gm...> - 2005-03-03 22:35:45
|
I managed to get it to work, by adding the following: MERGE2(max_interval=1000;min_interval=500) after the FD protocol in the stack Ben On 3 Mar 2005, at 22:05, Ben Middleton wrote: > I have something of a problem with my first foray into jgroups... > > I'm trying to connect two members to a group across a WAN but have > been unable to do so. > My code simply opens a channel using a stack published elsewhere on > this list, and despite the fact that the relevant ports are accessible > through the firewalls on each host machine (as tested with a simple > Java Socket example), the two hosts never form a group with each > other. > > It works fine across a LAN, just not across the WAN... can any experts > help? (or point me towards any useful example code/documentation...) > > thanks in advance, > > Ben > > > > FYI here's the code: > > import org.jgroups.ChannelException; > import org.jgroups.JChannel; > import org.jgroups.Message; > > public class ChannelTest { > > public static void main(String[] args) throws ChannelException { > String port = args[0]; > String members = args[1]; > String initialMembers = args[2]; > final String name = args[3]; > String props = "TCP(start_port="+port+"):" + //"TRACE:" + > > "TCPPING(initial_hosts="+members+";port_range=1;timeout=3000;" + > > "num_initial_members="+initialMembers+";up_thread=true; > down_thread=true):" + > "FD(timeout=2000;max_tries=4):" + > "VERIFY_SUSPECT(timeout=1500):" + > > "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):" > + > "pbcast.STABLE(desired_avg_gossip=10000):" + > "pbcast.GMS(join_timeout=60000;join_retry_timeout=10000;" + > "shun=false;print_local_addr=true):" + > "pbcast.STATE_TRANSFER"; > System.out.println("opening channel"); > final JChannel channel = new JChannel(props); > channel.connect("testGroup"); > Thread t = new Thread(){ > public void run(){ > while(true){ > try{ > System.out.println("---- sending message"); > channel.send(new Message(null,null,"MSG from > "+name)); > Thread.sleep(10000);}catch(Exception e){} > } > } > }; > t.start(); > while(true){ > System.out.println("---- waiting"); > try{ > Object o = channel.receive(0); > String contents = (String)((o instanceof Message)? > ((Message)o).getObject():""); > > System.out.println("---- received:"+o + " "+contents+" > members:"+channel.getView().getMembers()); > }catch(Exception e){ > e.printStackTrace(); > } > } > } > } > |