Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weed mount 不支持samba共享吗? #936

Closed
thatseason opened this issue Apr 24, 2019 · 25 comments
Closed

weed mount 不支持samba共享吗? #936

thatseason opened this issue Apr 24, 2019 · 25 comments

Comments

@thatseason
Copy link

正常挂载,本地访问正常,使用samba共享该文件夹后windows可以访问一级共享目录,二级目录提示“位置不可用”。
如:挂载点为/home/wwwroot,samba可以访问/home/wwwroot且可以列出目录及文件,但不可以访问/home/wwwroot/subdir,提示“位置不可用”。
weed mount不支持samba共享吗?

@chrislusf
Copy link
Collaborator

have not tested. Need to see some logs.

@thatseason
Copy link
Author

日志:

This is SeaweedFS version 1.28 linux amd64
2019/04/24 07:33:26 mount helper error: fusermount: unsafe option suid ignored

@chrislusf
Copy link
Collaborator

can not tell anything from one line of log.

@thatseason
Copy link
Author

如何debug?

@thatseason
Copy link
Author

日志里只有这些内容

@chrislusf
Copy link
Collaborator

Please show the steps to reproduce it with details, as what user, samba commands, etc.

@thatseason
Copy link
Author

samba配置:
[global]
workgroup = WORKGROUP
security = user
force user = www
passdb backend = tdbsam

[wwwroot]
comment = wwwroot
force user = www
path = /home/wwwroot/
writable = yes

然后su - www,切换用户后使用weed mount挂载
weed命令:
nohup /home/weed/weed mount -filer=127.0.0.1:8888 -dir=/home/wwwroot/abc.com/files -filer.path=/abc/files > ./logs/mount_abc.log 2>&1 &

@chrislusf
Copy link
Collaborator

samba seems having some cache. Need to mount the filer first, then restart samba.

@thatseason
Copy link
Author

不管用

@thatseason
Copy link
Author

thatseason commented Apr 24, 2019

不应该啊,我两台服务器都试过了,重启samba服务端,删除windows的samba缓存(net use /del)都不能访问。

@thatseason
Copy link
Author

Snipaste_2019-04-25_00-53-21

@chrislusf
Copy link
Collaborator

I used smbclient to test and got NT_STATUS_ACCESS_DENIED problem.
Not familiar with windows. But this problem seems a common one, and depends on your smb.conf.

Here is my smb.conf that worked. the "force user" and "force group" helped.

[profiles]
   comment = Users profiles
   path = /home/chris/mm
   guest ok = yes
   browseable = yes
   create mask = 0775
   directory mask = 0775
   force user = root
   force group = root

https://serverfault.com/questions/900440/samba-configuration-statusnt-status-access-denied
https://www.linuxquestions.org/questions/linux-software-2/smbclient-nt_status_access_denied-910103/

Below is the logs that it did not work at first. But after changing the smb.conf, it worked.

chris@ubuntu18:~$ smbclient //localhost/profiles
Enter WORKGROUP\chris's password:
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Wed Apr 24 23:32:30 2019
  ..                                  D        0  Wed Apr 24 23:28:13 2019
  command                             D        0  Wed Apr 24 19:07:24 2019
  filer2                              D        0  Wed Apr 24 19:07:24 2019
  filesys                             D        0  Wed Apr 24 19:07:24 2019
  glide.yaml                          N     1897  Wed Apr 24 19:07:24 2019
  glog                                D        0  Wed Apr 24 19:07:24 2019
  images                              D        0  Wed Apr 24 19:07:24 2019
  kraken                              D        0  Wed Apr 24 04:39:28 2019
  notification                        D        0  Wed Apr 24 19:07:24 2019
  operation                           D        0  Wed Apr 24 19:07:24 2019
  pb                                  D        0  Wed Apr 24 19:07:25 2019
  perftest                            D        0  Wed Apr 24 04:22:24 2019
  replication                         D        0  Wed Apr 24 19:07:25 2019
  s3api                               D        0  Wed Apr 24 19:07:25 2019
  security                            D        0  Wed Apr 24 19:07:25 2019
  sequence                            D        0  Wed Apr 24 19:07:25 2019
  server                              D        0  Wed Apr 24 19:07:25 2019
  shell                               D        0  Wed Apr 24 19:07:25 2019
  static                              D        0  Wed Apr 24 19:07:25 2019
  statik                              D        0  Wed Apr 24 19:07:25 2019
  stats                               D        0  Wed Apr 24 19:07:25 2019
  storage                             D        0  Wed Apr 24 19:07:25 2019
  topology                            D        0  Wed Apr 24 19:07:25 2019
  util                                D        0  Wed Apr 24 19:07:25 2019
  wdclient                            D        0  Wed Apr 24 19:07:25 2019
  weed.go                             N     3419  Wed Apr 24 19:07:25 2019

                215040000 blocks of size 1024. 215025264 blocks available
smb: \> cd wdclient
smb: \wdclient\> ls
NT_STATUS_ACCESS_DENIED listing \wdclient\*
smb: \wdclient\>
smb: \wdclient\> exit
chris@ubuntu18:~$ sudo vi /etc/samba/smb.conf
chris@ubuntu18:~$ smbclient //localhost/profiles
Enter WORKGROUP\chris's password:
Try "help" to get a list of possible commands.
smb: \> ls
  .                                   D        0  Wed Apr 24 23:32:30 2019
  ..                                  D        0  Wed Apr 24 23:38:16 2019
  command                             D        0  Wed Apr 24 19:07:24 2019
  filer2                              D        0  Wed Apr 24 19:07:24 2019
  filesys                             D        0  Wed Apr 24 19:07:24 2019
  glide.yaml                          N     1897  Wed Apr 24 19:07:24 2019
  glog                                D        0  Wed Apr 24 19:07:24 2019
  images                              D        0  Wed Apr 24 19:07:24 2019
  kraken                              D        0  Wed Apr 24 04:39:28 2019
  notification                        D        0  Wed Apr 24 19:07:24 2019
  operation                           D        0  Wed Apr 24 19:07:24 2019
  pb                                  D        0  Wed Apr 24 19:07:25 2019
  perftest                            D        0  Wed Apr 24 04:22:24 2019
  replication                         D        0  Wed Apr 24 19:07:25 2019
  s3api                               D        0  Wed Apr 24 19:07:25 2019
  security                            D        0  Wed Apr 24 19:07:25 2019
  sequence                            D        0  Wed Apr 24 19:07:25 2019
  server                              D        0  Wed Apr 24 19:07:25 2019
  shell                               D        0  Wed Apr 24 19:07:25 2019
  static                              D        0  Wed Apr 24 19:07:25 2019
  statik                              D        0  Wed Apr 24 19:07:25 2019
  stats                               D        0  Wed Apr 24 19:07:25 2019
  storage                             D        0  Wed Apr 24 19:07:25 2019
  topology                            D        0  Wed Apr 24 19:07:25 2019
  util                                D        0  Wed Apr 24 19:07:25 2019
  wdclient                            D        0  Wed Apr 24 19:07:25 2019
  weed.go                             N     3419  Wed Apr 24 19:07:25 2019

                215040000 blocks of size 1024. 215025264 blocks available
smb: \> cd wdclient
smb: \wdclient\> ls
  .                                   D        0  Wed Apr 24 19:07:25 2019
  ..                                  D        0  Wed Apr 24 23:32:30 2019
  masterclient.go                     N     3495  Wed Apr 24 19:07:25 2019
  vid_map.go                          N     2619  Wed Apr 24 19:07:25 2019

                215040000 blocks of size 1024. 215025264 blocks available
smb: \wdclient\> cd ..
smb: \> cd util
smb: \util\> ls
  .                                   D        0  Wed Apr 24 19:07:25 2019
  ..                                  D        0  Wed Apr 24 23:32:30 2019
  bytes.go                            N      829  Wed Apr 24 19:07:25 2019
  compression.go                      N     2009  Wed Apr 24 19:07:25 2019
  concurrent_read_map.go              N     1186  Wed Apr 24 19:07:25 2019
  config.go                           N      224  Wed Apr 24 19:07:25 2019
  constants.go                        N       94  Wed Apr 24 19:07:25 2019
  constants_4bytes.go                 N      101  Wed Apr 24 19:07:25 2019
  constants_5bytes.go                 N      104  Wed Apr 24 19:07:25 2019
  file_util.go                        N      592  Wed Apr 24 19:07:25 2019
  file_util_non_posix.go              N      236  Wed Apr 24 19:07:25 2019
  file_util_posix.go                  N      121  Wed Apr 24 19:07:25 2019
  grpc_client_server.go               N     3203  Wed Apr 24 19:07:25 2019
  http_util.go                        N     5522  Wed Apr 24 19:07:25 2019
  net_timeout.go                      N     1684  Wed Apr 24 19:07:25 2019
  parse.go                            N      464  Wed Apr 24 19:07:25 2019
  pprof.go                            N      543  Wed Apr 24 19:07:25 2019
  signal_handling.go                  N      720  Wed Apr 24 19:07:25 2019
  signal_handling_notsupported.go      N       63  Wed Apr 24 19:07:25 2019

                215040000 blocks of size 1024. 215025264 blocks available
smb: \util\> exit

@thatseason
Copy link
Author

thatseason commented Apr 28, 2019

Linux系统确实可以,Windows不行,望修复。

@thatseason
Copy link
Author

多次刷新之后 Linux 也不再能列出目录

@thatseason
Copy link
Author

我发现这个问题应该和seaweedfs没有关系,应该是和FUSE有关。
用SAMBA共享FUSE mount point会有问题,但是我没有找到解决方案,英文不太好,有些文章看不懂,你能帮帮我吗?

chrislusf added a commit that referenced this issue Apr 29, 2019
@chrislusf
Copy link
Collaborator

@thatseason
Copy link
Author

没有效果,还是同样的错误。
在Centos7下,用mount -t cifs挂载之后,第一次用ls命令可以列出二级以下的目录,但是再返回到二级目录时,无法再列出,但是可以直接用cd命令进入到子文件夹。
再有一点,就算进入子文件夹后也无法创建文件。

@chrislusf
Copy link
Collaborator

samba seems too finicky.

Please try to use WebDav to share the FUSE mounted folder.

@chrislusf
Copy link
Collaborator

added "weed webdav" command in 9d3c945

@thatseason
Copy link
Author

经过测试(将webdav挂载到windows server 2016上的网络位置),在IO频繁的场景,会出现无法访问的情况,具体表现为:可以创建文件,但是无法写入文件内容,所有文件均为0KB,并且IO不会报错。

@chrislusf
Copy link
Collaborator

webdav has many subtle variations for different implementations. Need logs or something reproducible.

@thatseason
Copy link
Author

非常抱歉这么久才再次回复
经过这一周测试,我觉得没有必要再研究WebDav了。
我试过多种客户端,多次测试,windows应用程序都不能正常访问webdav挂载点的内容。日志内容无异常,但windows程序无法正确识别文件。
似乎只有samba以及nfs可以解决这个问题,我遇到的问题:
现在项目中有视频需要处理,且原有工具是windows程序,在以前直接用samba共享linux文件服务器时可以正常读写挂载点,但是小文件越来越多,我最终找到了你这个项目来替代原来的直接存盘。
可是这个共享问题一直没有解决,看了s3的文档,他们在2018年7月加入了NFS和SAMBA的支持来解决windows访问s3的问题,所以很期待你能在文件接口上加上NFS或SAMBA支持。
谢谢

@chrislusf
Copy link
Collaborator

there are already "weed s3" command for S3 APIs. You can use your NFS or SAMBA to access it.

@thatseason
Copy link
Author

我并不使用S3,用s3加入nfs和samba支持只是想说明webdav可能在windows下不是那么完美,许多windows程序无法直接访问webdav挂载点的文件。

@lze693
Copy link

lze693 commented Oct 17, 2020

您好 weed s3 该如何开启NFS呢 cmd mount -o nolock -o mtype=hard 192.168.35.110:/test T: 报错(找不到网络路径。)已将8333改为80端口了 浏览器访问 192.168.35.110也能看到页面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants