aboutsummaryrefslogtreecommitdiff
path: root/weed/command/mount2.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-27 02:57:27 -0800
committerchrislu <chris.lu@gmail.com>2022-02-27 02:57:27 -0800
commitaa9eef81e61f29e1801b2e23a6d8db8a4836cb9c (patch)
tree0f363cd660788ac7b273246e62f3ea493ec71857 /weed/command/mount2.go
parent22362f64958f8587992f98eb2f7fac95fd204516 (diff)
downloadseaweedfs-aa9eef81e61f29e1801b2e23a6d8db8a4836cb9c.tar.xz
seaweedfs-aa9eef81e61f29e1801b2e23a6d8db8a4836cb9c.zip
retire mount v1
Diffstat (limited to 'weed/command/mount2.go')
-rw-r--r--weed/command/mount2.go65
1 files changed, 34 insertions, 31 deletions
diff --git a/weed/command/mount2.go b/weed/command/mount2.go
index b285f5d3f..545ba8a43 100644
--- a/weed/command/mount2.go
+++ b/weed/command/mount2.go
@@ -5,7 +5,7 @@ import (
"time"
)
-type Mount2Options struct {
+type MountOptions struct {
filer *string
filerMountRootPath *string
dir *string
@@ -31,42 +31,45 @@ type Mount2Options struct {
}
var (
- mount2Options Mount2Options
+ mountOptions MountOptions
+ mountCpuProfile *string
+ mountMemProfile *string
+ mountReadRetryTime *time.Duration
)
func init() {
- cmdMount2.Run = runMount2 // break init cycle
- mount2Options.filer = cmdMount2.Flag.String("filer", "localhost:8888", "comma-separated weed filer location")
- mount2Options.filerMountRootPath = cmdMount2.Flag.String("filer.path", "/", "mount this remote path from filer server")
- mount2Options.dir = cmdMount2.Flag.String("dir", ".", "mount weed filer to this directory")
- mount2Options.dirAutoCreate = cmdMount2.Flag.Bool("dirAutoCreate", false, "auto create the directory to mount to")
- mount2Options.collection = cmdMount2.Flag.String("collection", "", "collection to create the files")
- mount2Options.replication = cmdMount2.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.")
- mount2Options.diskType = cmdMount2.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
- mount2Options.ttlSec = cmdMount2.Flag.Int("ttl", 0, "file ttl in seconds")
- mount2Options.chunkSizeLimitMB = cmdMount2.Flag.Int("chunkSizeLimitMB", 2, "local write buffer size, also chunk large files")
- mount2Options.concurrentWriters = cmdMount2.Flag.Int("concurrentWriters", 32, "limit concurrent goroutine writers if not 0")
- mount2Options.cacheDir = cmdMount2.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks and meta data")
- mount2Options.cacheSizeMB = cmdMount2.Flag.Int64("cacheCapacityMB", 0, "local file chunk cache capacity in MB")
- mount2Options.dataCenter = cmdMount2.Flag.String("dataCenter", "", "prefer to write to the data center")
- mount2Options.allowOthers = cmdMount2.Flag.Bool("allowOthers", true, "allows other users to access the file system")
- mount2Options.umaskString = cmdMount2.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
- mount2Options.nonempty = cmdMount2.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
- mount2Options.volumeServerAccess = cmdMount2.Flag.String("volumeServerAccess", "direct", "access volume servers by [direct|publicUrl|filerProxy]")
- mount2Options.uidMap = cmdMount2.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
- mount2Options.gidMap = cmdMount2.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
- mount2Options.readOnly = cmdMount2.Flag.Bool("readOnly", false, "read only")
- mount2Options.debug = cmdMount2.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
- mount2Options.debugPort = cmdMount2.Flag.Int("debug.port", 6061, "http port for debugging")
+ cmdMount.Run = runMount // break init cycle
+ mountOptions.filer = cmdMount.Flag.String("filer", "localhost:8888", "comma-separated weed filer location")
+ mountOptions.filerMountRootPath = cmdMount.Flag.String("filer.path", "/", "mount this remote path from filer server")
+ mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory")
+ mountOptions.dirAutoCreate = cmdMount.Flag.Bool("dirAutoCreate", false, "auto create the directory to mount to")
+ mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files")
+ mountOptions.replication = cmdMount.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.")
+ mountOptions.diskType = cmdMount.Flag.String("disk", "", "[hdd|ssd|<tag>] hard drive or solid state drive or any tag")
+ mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")
+ mountOptions.chunkSizeLimitMB = cmdMount.Flag.Int("chunkSizeLimitMB", 2, "local write buffer size, also chunk large files")
+ mountOptions.concurrentWriters = cmdMount.Flag.Int("concurrentWriters", 32, "limit concurrent goroutine writers if not 0")
+ mountOptions.cacheDir = cmdMount.Flag.String("cacheDir", os.TempDir(), "local cache directory for file chunks and meta data")
+ mountOptions.cacheSizeMB = cmdMount.Flag.Int64("cacheCapacityMB", 0, "local file chunk cache capacity in MB")
+ mountOptions.dataCenter = cmdMount.Flag.String("dataCenter", "", "prefer to write to the data center")
+ mountOptions.allowOthers = cmdMount.Flag.Bool("allowOthers", true, "allows other users to access the file system")
+ mountOptions.umaskString = cmdMount.Flag.String("umask", "022", "octal umask, e.g., 022, 0111")
+ mountOptions.nonempty = cmdMount.Flag.Bool("nonempty", false, "allows the mounting over a non-empty directory")
+ mountOptions.volumeServerAccess = cmdMount.Flag.String("volumeServerAccess", "direct", "access volume servers by [direct|publicUrl|filerProxy]")
+ mountOptions.uidMap = cmdMount.Flag.String("map.uid", "", "map local uid to uid on filer, comma-separated <local_uid>:<filer_uid>")
+ mountOptions.gidMap = cmdMount.Flag.String("map.gid", "", "map local gid to gid on filer, comma-separated <local_gid>:<filer_gid>")
+ mountOptions.readOnly = cmdMount.Flag.Bool("readOnly", false, "read only")
+ mountOptions.debug = cmdMount.Flag.Bool("debug", false, "serves runtime profiling data, e.g., http://localhost:<debug.port>/debug/pprof/goroutine?debug=2")
+ mountOptions.debugPort = cmdMount.Flag.Int("debug.port", 6061, "http port for debugging")
- mountCpuProfile = cmdMount2.Flag.String("cpuprofile", "", "cpu profile output file")
- mountMemProfile = cmdMount2.Flag.String("memprofile", "", "memory profile output file")
- mountReadRetryTime = cmdMount2.Flag.Duration("readRetryTime", 6*time.Second, "maximum read retry wait time")
+ mountCpuProfile = cmdMount.Flag.String("cpuprofile", "", "cpu profile output file")
+ mountMemProfile = cmdMount.Flag.String("memprofile", "", "memory profile output file")
+ mountReadRetryTime = cmdMount.Flag.Duration("readRetryTime", 6*time.Second, "maximum read retry wait time")
}
-var cmdMount2 = &Command{
- UsageLine: "mount2 -filer=localhost:8888 -dir=/some/dir",
- Short: "<WIP> mount weed filer to a directory as file system in userspace(FUSE)",
+var cmdMount = &Command{
+ UsageLine: "mount -filer=localhost:8888 -dir=/some/dir",
+ Short: "mount weed filer to a directory as file system in userspace(FUSE)",
Long: `mount weed filer to userspace.
Pre-requisites: