aboutsummaryrefslogtreecommitdiff
path: root/weed/command/weedfuse/README.md
blob: 1a1496bbbb0b242705c8208527d0de250c73f234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Mount the SeaweedFS via FUSE

# Mount by fstab


```
$ # on linux
$ sudo apt-get install fuse
$ sudo echo 'user_allow_other' >> /etc/fuse.conf
$ sudo mv weedfuse /sbin/mount.weedfuse

$ # on Mac
$ sudo mv weedfuse /sbin/mount_weedfuse

```

On both OS X and Linux, you can add one of the entries to your /etc/fstab file like the following:

```
# mount the whole SeaweedFS
localhost:8888/    /home/some/mount/folder  weedfuse

# mount the SeaweedFS sub folder
localhost:8888/sub/dir    /home/some/mount/folder  weedfuse

# mount the SeaweedFS sub folder with some options
localhost:8888/sub/dir    /home/some/mount/folder  weedfuse  user

```

To verify it can work, try this command
```
$ sudo mount -av

...

/home/some/mount/folder           : successfully mounted

```

If you see `successfully mounted`, try to access the mounted folder and verify everything works.


To debug, run these:
```

$ weedfuse -foreground localhost:8888/ /home/some/mount/folder

```


To unmount the folder:
```

$ sudo umount /home/some/mount/folder

```

<!-- not working yet!

# Mount by autofs

AutoFS can mount a folder if accessed.

```
# install autofs
$ sudo apt-get install autofs
```

Here is an example on how to mount a folder for all users under `/home` directory.
Assuming there exists corresponding folders under `/home` on both local and SeaweedFS.

Edit `/etc/auto.master` and `/etc/auto.weedfuse` file with these content
```
$ cat /etc/auto.master
/home    /etc/auto.weedfuse

$ cat /etc/auto.weedfuse
# map /home/<user> to localhost:8888/home/<user>
* -fstype=weedfuse,rw,allow_other,foreground :localhost\:8888/home/&

```

-->