Let's start with: I am a newbie to jgroups. So be patient with me ;-)
What I try to achieve are distributed locks.
Right now I do my first tests locally with one node. And some things seem to work already (a bit):
I can get a lock and a second attempt in the same session (same lock service instance) to get a lock fails.
But another instance of the lock service does not seem to "see" any locks held by the other "session".
The problem might be related to the warnings I see in the server log:
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could not join /228.8.8.8:45588 on interface net0
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could not join /228.8.8.8:45588 on interface eth0
...
...
Let's start with: I am a newbie to jgroups. So be patient with me ;-)
always am... :-)
What I try to achieve are distributed locks.
Right now I do my first tests locally with one node. And some things
seem to work already (a bit):
I can get a lock and a second attempt in the same session (same lock
service instance) to get a lock fails.
But another instance of the lock service does not seem to "see" any
locks held by the other "session".
The problem might be related to the warnings I see in the server log:
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could
not join /228.8.8.8:45588 on interface net0
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could
not join /228.8.8.8:45588 on interface eth0
Could be that your cluster doesn't form. I suggest use probe.sh (check
the manual for details) to see if the cluster forms correctly. Also I
suggest set UDP.bind_addr/mcast_addr, and verify you have a multicast
route. See https://github.com/belaban/JGroups/wiki/Multicast-routing-on-Mac-OS for
details. It is for MacOS, but I guess other systems have this issue, too.
You probably have no route (netstat -nr will show you) from 192.168. to
224..
I suggest do not use 224.x.x.x, as routers may even discard
application traffic to these addrs. I suggest use sth like 232.5.5.5 and
perhaps add a route to it:
JChannel ch = new JChannel(props);
lockService = new LockService(ch);
ch.connect("lock-cluster");
I see the following lines in the server log:
JGRP000048: Could not join /224.0.0.0:45588 on interface net0
JGRP000048: Could not join /224.0.0.0:45588 on interface eth0
JGRP000048: Could not join /224.0.0.0:45588 on interface net1
JGRP000048: Could not join /224.0.0.0:45588 on interface eth2
JGRP000048: Could not join /224.0.0.0:45588 on interface eth3
...
Hmm. Things improved. A lot :-)
But I am not exactly sure why.
In the last tests I was so focused on the log messages ("Could not join ...") that I didn't check the lock functionality itself. And surprise - it works now, as far as I can tell! But the warnings in the log still remain.
One thing I noticed was some strange socket binding with a multi cast address of "192.168.1.21". Maybe things got better after removing that. I will recheck...
As for the lock functionality... What is the expected behaviour if client 1 gets a lock on "asdf", then client 2 tries to get a lock on "asdf" using a 10 sec timeout. Client 1 releases the lock within these 10 sec. Is tryLock returning true on client 2 after the unlock on client 1?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hmm. Things improved. A lot :-)
But I am not exactly sure why.
In the last tests I was so focused on the log messages ("Could not join
...") that I didn't check the lock functionality itself. And surprise -
it works now, as far as I can tell! But the warnings in the log still
remain.
Perhaps you should post the full logs of the 2 members' startup
One thing I noticed was some strange socket binding with a multi cast
address of "192.168.1.21". Maybe things got better after removing that.
What are you referring to? You posted mcast_addr="224.0.0.0", not
192.168.1.21!
I will recheck...
As for the lock functionality... What is the expected behaviour if
client 1 gets a lock on "asdf", then client 2 tries to get a lock on
"asdf" using a 10 sec timeout. Client 1 releases the lock within these
10 sec. Is tryLock returning true on client 2 after the unlock on client 1?
Oh. I just noticed that releasing the lock on client 1 does not succeed if client 2 is trying to get a lock with timeout. Is that the expected behaviour?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh. I just noticed that releasing the lock on client 1 does not succeed
if client 2 is trying to get a lock with timeout. Is that the expected
behaviour?
I see a different behaviour. Client 1 obviously does not release the lock if a tryLock of client 2 is busy. There is no error. But I can tell from calling printLocks afterwards.
Without a running tryLock of client 2 releasing the lock works as expected.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Works for me, with CENTRAL_LOCK2 though... haven't looked at
CENTRAL_LOCK for a while. Have you tried with 4.1.8?
On 27.11.19 13:06, Heiko Tappe wrote:
I see a different behaviour. Client 1 obviously does not release the
lock if a tryLock of client 2 is busy. There is no error. But I can tell
from calling printLocks afterwards.
Without a running tryLock of client 2 releasing the lock works as expected.
Let's start with: I am a newbie to jgroups. So be patient with me ;-)
What I try to achieve are distributed locks.
Right now I do my first tests locally with one node. And some things seem to work already (a bit):
I can get a lock and a second attempt in the same session (same lock service instance) to get a lock fails.
But another instance of the lock service does not seem to "see" any locks held by the other "session".
The problem might be related to the warnings I see in the server log:
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could not join /228.8.8.8:45588 on interface net0
WARN [org.jgroups.protocols.UDP] (default task-2) JGRP000048: Could not join /228.8.8.8:45588 on interface eth0
...
...
Any idea?
Thanks in advance,
Heiko
BTW, my properties look like this:
On 26.11.19 11:27 AM, Heiko Tappe wrote:
always am... :-)
Could be that your cluster doesn't form. I suggest use probe.sh (check
the manual for details) to see if the cluster forms correctly. Also I
suggest set UDP.bind_addr/mcast_addr, and verify you have a multicast
route. See
https://github.com/belaban/JGroups/wiki/Multicast-routing-on-Mac-OS for
details. It is for MacOS, but I guess other systems have this issue, too.
--
Bela Ban, JGroups lead (http://www.jgroups.org)
Here is what I got...
I explicitly defined UDP like this:
When I start my server (Wildfly 17.0.1.Final) and call probe like this:
$ java -cp jgroups-4.0.19.Final.jar -Djava.net.preferIPv4Stack=true org.jgroups.tests.Probe
I get
0 responses (0 matches, 0 non matches)
If I then init the LockService like this:
I see the following lines in the server log:
Probing again gives me:
Does that help? I am clueless :-(
You probably have no route (netstat -nr will show you) from 192.168. to
224..
I suggest do not use 224.x.x.x, as routers may even discard
application traffic to these addrs. I suggest use sth like 232.5.5.5 and
perhaps add a route to it:
sudo route add -net 232.0.0.0/5 192.168.1.21
On 27.11.19 9:00 AM, Heiko Tappe wrote:
--
Bela Ban, JGroups lead (http://www.jgroups.org)
I switched to 232.5.5.5 with no success.
netstat -nr gives me:
$netstat -an | find ":45588" returns:
UDP 0.0.0.0:45588 *:*
Why '0.0.0.0'? I expected to see some multicast address!?
Just again to clarify:
I am still "local" with just one node/server - no cluster yet! Windows 10 client.
Try setting receive_on_all_interfaces to false, and use 4.1.8.Final
Hmm. Things improved. A lot :-)
But I am not exactly sure why.
In the last tests I was so focused on the log messages ("Could not join ...") that I didn't check the lock functionality itself. And surprise - it works now, as far as I can tell! But the warnings in the log still remain.
One thing I noticed was some strange socket binding with a multi cast address of "192.168.1.21". Maybe things got better after removing that. I will recheck...
As for the lock functionality... What is the expected behaviour if client 1 gets a lock on "asdf", then client 2 tries to get a lock on "asdf" using a 10 sec timeout. Client 1 releases the lock within these 10 sec. Is tryLock returning true on client 2 after the unlock on client 1?
On 27.11.19 12:40, Heiko Tappe wrote:
Perhaps you should post the full logs of the 2 members' startup
What are you referring to? You posted mcast_addr="224.0.0.0", not
192.168.1.21!
Yes
--
Bela Ban | http://www.jgroups.org
As for the mcast_addr - I found this in my wildfly socket bindings config and removed it:
<socket-binding name="jgroups-diagnostics" multicast-address="${jboss.jgroups.diagnostics_addr:192.168.1.21}" multicast-port="${jboss.jgroups.diagnostics_port:7500}"/>
Oh. I just noticed that releasing the lock on client 1 does not succeed if client 2 is trying to get a lock with timeout. Is that the expected behaviour?
On 27.11.19 12:42, Heiko Tappe wrote:
--
Bela Ban | http://www.jgroups.org
I see a different behaviour. Client 1 obviously does not release the lock if a tryLock of client 2 is busy. There is no error. But I can tell from calling printLocks afterwards.
Without a running tryLock of client 2 releasing the lock works as expected.
Works for me, with CENTRAL_LOCK2 though... haven't looked at
CENTRAL_LOCK for a while. Have you tried with 4.1.8?
On 27.11.19 13:06, Heiko Tappe wrote:
--
Bela Ban | http://www.jgroups.org
Tried with CENTRAL_LOCK2. Same behaviour.
As for 4.1.8 - I don't know if I can just replace the jgroups wildfly module 4.0.19.Final with 4.1.8. First attempt gives me a
java.lang.NoSuchMethodError: org.jgroups.conf.XmlConfigurator.getInstance(Ljava/net/URL;)Lorg/jgroups/conf/XmlConfigurator
Oops. Missed the method:
org.jgroups.conf.XmlConfigurator.getInstance(Ljava/net/URL;)
And it's correct. There is no getInstance with a URL param any more.
Tried 4.0.21.Final. Unfortunately without success.