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

Autofs support #1674

Closed
nivekuil opened this issue Dec 13, 2020 · 5 comments
Closed

Autofs support #1674

nivekuil opened this issue Dec 13, 2020 · 5 comments

Comments

@nivekuil
Copy link
Contributor

Autofs is a handy tool to make FUSE mounts resilient and easy to use: https://help.ubuntu.com/community/Autofs#FUSE_based_file_systems

I see this isn't a supported use case yet but it would be very nice to get it working. Also related to #1323 in terms of getting SeaweedFS to work with standard Linux tools. No luck so far with seaweedfs (2.15), but if anyone wants to try to help get it working, here is my setup:

$ apt install autofs
autofs is already the newest version (5.1.6-2ubuntu0.1).
/etc/auto.master

/- /etc/auto.seaweed
/etc/auto.seaweed

/mnt/seaweed -fstype=fuse :weedmount
/usr/bin/weedmount

#!/bin/sh
/usr/bin/weed mount -dir=/mnt/seaweed -dirAutoCreate -outsideContainerClusterMode
$ automount -f -v
Starting automounter version 5.1.6, master map /etc/auto.master
using kernel protocol version 5.05
mounted direct on /mnt/seaweed with timeout 300, freq 75 seconds

$ ls /mnt/seaweed
attempting to mount entry /mnt/seaweed
>> This is SeaweedFS version 30GB 2.15 813453f linux amd64
>> mount point owner uid=0 gid=0 mode=drwxr-xr-x
>> current uid=0 gid=0
>> F1213 23:11:03 68372 mount_std.go:133] Expected mount to still be active, target mount point: /mnt/seaweed, please check!
>> goroutine 1 [running]:
>> github.com/chrislusf/seaweedfs/weed/glog.stacks(0xc0006e7d00, 0xc0004600e0, 0x7a, 0xd2)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:767 +0xb9
>> github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).output(0x32683e0, 0xc000000003, 0xc000464310, 0x316f4a5, 0xc, 0x85, 0x0)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:718 +0x385
>> github.com/chrislusf/seaweedfs/weed/glog.(*loggingT).printf(0x32683e0, 0x3, 0x210adab, 0x48, 0xc0007f3b68, 0x1, 0x1)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:656 +0x153
>> github.com/chrislusf/seaweedfs/weed/glog.Fatalf(...)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/glog/glog.go:1149
>> github.com/chrislusf/seaweedfs/weed/command.RunMount(0x32680c0, 0x12, 0x0)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/mount_std.go:133 +0x1869
>> github.com/chrislusf/seaweedfs/weed/command.runMount(0x324d040, 0xc00003a0b0, 0x0, 0x0, 0x0)
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/command/mount_std.go:48 +0xeb
>> main.main()
>> 	/home/travis/gopath/src/github.com/chrislusf/seaweedfs/weed/weed.go:66 +0x30e
mount(generic): failed to mount weedmount (type fuse) on /mnt/seaweed
@nivekuil
Copy link
Contributor Author

nivekuil commented Dec 14, 2020

So I have this mostly working. I commented out the if block giving the above error, and used an autofs executable map:

/etc/auto.master

/mnt/seaweed2 auto_execute_seaweedfs
/etc/auto_execute_seaweedfs

#!/bin/sh
/root/go/bin/weed mount -dir=/mnt/seaweed2 -dirAutoCreate -outsideContainerClusterMode

Now what happens is: the first ls /mnt/seaweed2/topics hangs, but it does successfully mount in the background, so subsequent operations work.

@chrislusf
Copy link
Collaborator

I could not tell exactly why "the first ls /mnt/seaweed2/topics hangs". Do you have a docker file or image that I can try easily?

@nivekuil
Copy link
Contributor Author

I can take a look later, but for now I think weed mount needs a few patches to work properly inside docker.

@chrislusf
Copy link
Collaborator

This issue has some commands that can work. #1182

docker run --rm -it --network seaweedfs_default --device /dev/fuse --cap-add SYS_ADMIN --entrypoint /bin/sh chrislusf/seaweedfs

@chrislusf
Copy link
Collaborator

#2085 should have resolved this.

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

2 participants