You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

8 years ago
  1. package command
  2. type MountOptions struct {
  3. filer *string
  4. filerGrpcPort *int
  5. dir *string
  6. collection *string
  7. replication *string
  8. ttlSec *int
  9. chunkSizeLimitMB *int
  10. }
  11. var (
  12. mountOptions MountOptions
  13. )
  14. func init() {
  15. cmdMount.Run = runMount // break init cycle
  16. mountOptions.filer = cmdMount.Flag.String("filer", "localhost:8888", "weed filer location")
  17. mountOptions.filerGrpcPort = cmdMount.Flag.Int("filer.grpc.port", 0, "filer grpc server listen port, default to http port + 10000")
  18. mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory")
  19. mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files")
  20. mountOptions.replication = cmdMount.Flag.String("replication", "000", "replication to create to files")
  21. mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")
  22. mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 16, "local write buffer size, also chunk large files")
  23. }
  24. var cmdMount = &Command{
  25. UsageLine: "mount -filer=localhost:8888 -dir=/some/dir",
  26. Short: "mount weed filer to a directory as file system in userspace(FUSE)",
  27. Long: `mount weed filer to userspace.
  28. Pre-requisites:
  29. 1) have SeaweedFS master and volume servers running
  30. 2) have a "weed filer" running
  31. These 2 requirements can be achieved with one command "weed server -filer=true"
  32. This uses bazil.org/fuse, which enables writing FUSE file systems on
  33. Linux, and OS X.
  34. On OS X, it requires OSXFUSE (http://osxfuse.github.com/).
  35. `,
  36. }