I have two SLES 11 servers that are SAN attached to a Clarion CX-340. The SAN partition has been formatted with ocfs2 and I have both machines setup in a cluster and the cluster is running (all appears to be normal). I have a small java application as a locking test and when I run the application on both machines at the same time, I should get the lock on one server and the other should refuse the lock since the first already holds a lock on that file but in this case both servers get a lock on the same file.
Basically my cluster.conf looks like this:
node:
ip_port = 7777
ip_address = 192.168.10.121
number = 1
name = osrsles10node1
cluster = osrsles10
node:
ip_port = 7777
ip_address = 192.168.10.122
number = 2
name = osrsles10node2
cluster = osrsles10
cluster:
node_count = 2
name = osrsles10
Please ask for any other info - I really need these locks to be exclusive to each server.
Thanks.
What type of locking are you using? flock(2), fcntl(2)? If you're not sure, you can run your Java app under strace to find out.
OCFS2 only supports cluster-wide flock - not fcntl.