[Samba] NAS and 2 active Samba servers / locking not working

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Jan 9 06:50:08 MST 2013


On Wed, Jan 09, 2013 at 01:54:28PM +0100, "Björn Matthiessen" wrote:
> Hi,
> 
> I have one NAS which I can access via NFS or Samba.
> This storage is accessed by 2 linux servers with Samba where I re-export the NAS share. This is sort of an active/active loadbalancing cluster.
> The only thing not working is locking... If a client opens a Word-File via server1 and another opens the same via server2 it won't inform the user that he can only open the file readonly.
> I was hoping, that the NFS server will tell Samba that the file is already in use (rw) - didn't happen.
> When I switched from NFS to Samba on the NAS and checked the NAS-Server, Server1 and Server2 with smbstatus I see the following:
> NAS:
> Locked files:
> Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
> --------------------------------------------------------------------------------------------------
> 6893         0          DENY_NONE  0x19b       RDWR       NONE             /export/storage   smbshare/bla/bla1.docx
> 
> Server1:
> Locked files:
> Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
> --------------------------------------------------------------------------------------------------
> 2004         0          DENY_WRITE 0x2019f     RDWR       NONE             /import/999999/smbshare   bla/bla1.docx
> 
> Sever2:
> Locked files:
> Pid          Uid        DenyMode   Access      R/W        Oplock           SharePath   Name   Time
> --------------------------------------------------------------------------------------------------
> 1442         0          DENY_WRITE 0x2019f     RDWR       NONE             /import/999999/smbshare   bla/bla1.docx
>  
> Of course every server has its own locking DB but why does the NAS not set DenyMode to DENY_WRITE I'd hope that this would do the trick...
> I also tried to use ctdb on the 2 servers but afaik it'll only work with a Cluster-FS and not with a NFS or Samba share. At least ping_pong stopped working as soon as I started it on the 2nd server.
> 
> Does anyone has any idea how I can get file locking working with this setup (1 NAS and 2 active Samba servers)?

Sorry, that won't work. Those problems are the exact reasons
why the GFS/OCFS/etc people go through their pains and we go
through ours with ctdb and Samba.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba mailing list