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.

48 lines
1.8 KiB

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