我们希望在NetApp文件服务器上更改文件,并在每次更改这些文件时,Debian机器会将这些文件复制到另外两个共享文件夹中。
由于我们使用的是lsync的重复方法,我们需要挂载Samba共享(NetApp存储),并使用Samba重新共享,我们正在从Debian机器的共享而不是NetApp进行所有更改。
问题是,有时在某些树级别,我们将文件夹视为文件而不是文件夹。
例如,树看起来像这样:
/ --fol1 +--fol5 +--fol6 --fol2 +--fol3 +--fol4
所有fol4 / fol6级别的文件夹,无论他们的父母是什么,看起来都是一个文件。
注意:从Debian系统看起来都不错,只有在Debian机器上看到Samba共享的Windows机器上才会出现问题。
一些想法如何解决这个问题?
smb.conf文件:
guest account = nobody map to guest = bad user disable netbios = yes socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=131072 SO_SNDBUF=242144 strict sync = no acl check permissions = no oplocks = False level2oplocks = False sync always = no [reshare] comment =reshare the netapp with debian to able to see the file change events path = /netapp/ hosts allow =host1;host2; writable = yes guest ok = yes force user = user1; workgroup = SERVERS server string = %h server dns proxy = no log file = /var/log/samba/log.%m max log size = 1000 syslog = 0 panic action = /usr/share/samba/panic-action %d encrypt passwords = true passdb backend = tdbsam obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . pam password change = yes
如果你使用cifs作为netapp共享,不要转发netapp共享,请尝试使用samba dfs。
这是一个来自桑巴官方文档的例子。
root# cd /export/dfsroot root# chown root /export/dfsroot root# chmod 755 /export/dfsroot root# ln -s msdfs:storageA\\shareA linka root# ln -s msdfs:serverB\\share,serverC\\share linkb Example 20.1. smb.conf with DFS Configured [global] netbios name = GANDALF host msdfs = yes [dfs] path = /export/dfsroot msdfs root = yes
这样,你的debian就像是netapp股票的代理