2

I'm trying to run the Draw example and communicate between two different machines. It works fine on same machine using this command:

java -Djgroups.bind_addr=127.0.0.1 -Djava.net.preferIPv4Stack=true org.jgroups.demos.Draw

Now I tried giving the IPv4Address of the other machine in bind_addr and it gave me an error saying

/'other.machine.ip' is not a valid address on any local network interface

Please tell me the command or what bind_addr should I give for the both machines to connect. Sorry I just started on this, so please tell me in simple works and exact details.

EDIT:

Ok. Here are the steps I followed:

  1. Downloaded jgroups.jar
  2. Gave the CLASSPATH like this: "C:\jgroups\jgroups-3.6.1.Final.jar"
  3. Extracted the jar file.
  4. Ran this command on machine A: java -Djgroups.bind_addr="Gave local IPv4 Address" -Djava.net.preferIPv4Stack=true org.jgroups.demos.Draw
  5. Ran this command on machine B: java -Djgroups.bind_addr="Gave local IPv4 Address" -Djava.net.preferIPv4Stack=true org.jgroups.demos.Draw
  6. But I was unable to communicate (Drew something on machine A and it was not updated on machine B)

Note: By the way, I was able to ping both machines. And I also disabled the firewall just in case.

Am I doing something wrong or is missing something? Any help would be appreciated.

EDIT 2:

SOLVED!

As it turned out, I was doing everything right. What I did was just downloaded the previous version of jgroups (in my case, 3.4.7). And everything worked fine.

Sibtain
  • 1,436
  • 21
  • 39

2 Answers2

2

bind_addr needs to be the IP address of the local machine. It cannot be 127.0.0.1 because that won't get routed to other boxes, so use a link local address, e.g. 192.168.x.x or 10.0.x.x. Assuming you use udp.xml with UDP:PING, that's all you need to do. If you use TCP, you'll need to set a bind_port in TCP and list all of your instances in TCPPING.initial_hosts, e.g. initial_hosts="192.168.1.1[7800],192.168.1.5[7800],..."

Bela Ban
  • 2,186
  • 13
  • 12
0

Are you able to ping other.machine.ip ?

For my setup I use the following system properties -

-Djgroups.bind_port=7802 -Djgroups.bind_addr=HOST3 -Djgroups.tcpping.initial_hosts=HOST1[7800],HOST2[7801],HOST3[7802]

Could be worth trying those on each process

TFlanagan
  • 13
  • 1
  • 6