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.

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