Search code examples
jgroups

Getting JGroups to work


I'm a Java programming novice. I liked the sound of JGroups and thought I'd have a look. Downloaded the ReplCaheDemo jar and thought it was great. Downloaded the JGroups-master zip, extracted, used the ReplCacheDemo class in a Netbeans package and imported the JGroups final jar as a library. ran multiple instances fine on a single computer. However when trying to run multiple instances over different computers, the instances don't find each other. But the ReplCacheDemo jar from the website does find other instances of itself. I am confused and frustrated. Please help! P.S. I dont know if it has any bearing, but instances I run of the ReplcCacheDemo I made report a physical address that is my PC name, not just an IP address like in the jar from the website


Solution

  • A couple of things to check:

    • Are firewalls enabled (iptables -L) ? Disable them to see if this works.

    • Make sure the bind address is correct, e.g. start the app with -Djgroups.bind_addr=192.168.1.5 (pick the right address, not 127.0.0.1)

    • You may have to pick an IPv4 address, unless IPv6 routing is setup correctly: -Djava.net.preferIPv4Stack=true