aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-08 23:57:15 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-08 23:57:15 -0700
commitf6a7e79dc370dfb2e3fe5bff6a380afde95b9a7f (patch)
tree716ffa52d4efe0705789eb6b527f2c370a341f7e /weed/command
parent2329d9e0c18aa2dbc2b843a43fe269ee539a0f39 (diff)
downloadseaweedfs-f6a7e79dc370dfb2e3fe5bff6a380afde95b9a7f.tar.xz
seaweedfs-f6a7e79dc370dfb2e3fe5bff6a380afde95b9a7f.zip
weed shell: simplify CLI option for filer
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/scaffold.go3
-rw-r--r--weed/command/shell.go15
2 files changed, 10 insertions, 8 deletions
diff --git a/weed/command/scaffold.go b/weed/command/scaffold.go
index f2832510c..2aad29548 100644
--- a/weed/command/scaffold.go
+++ b/weed/command/scaffold.go
@@ -364,7 +364,8 @@ scripts = """
sleep_minutes = 17 # sleep minutes between each script execution
[master.filer]
-default_filer_url = "http://localhost:8888/"
+default = "localhost:8888" # used by maintenance scripts if the scripts needs to use fs related commands
+
[master.sequencer]
type = "memory" # Choose [memory|etcd] type for storing the file id sequence
diff --git a/weed/command/shell.go b/weed/command/shell.go
index dcf70608f..6dd768f47 100644
--- a/weed/command/shell.go
+++ b/weed/command/shell.go
@@ -9,14 +9,14 @@ import (
)
var (
- shellOptions shell.ShellOptions
- shellInitialFilerUrl *string
+ shellOptions shell.ShellOptions
+ shellInitialFiler *string
)
func init() {
cmdShell.Run = runShell // break init cycle
shellOptions.Masters = cmdShell.Flag.String("master", "localhost:9333", "comma-separated master servers")
- shellInitialFilerUrl = cmdShell.Flag.String("filer.url", "http://localhost:8888/", "initial filer url")
+ shellInitialFiler = cmdShell.Flag.String("filer", "localhost:8888", "filer host and port")
}
var cmdShell = &Command{
@@ -32,12 +32,13 @@ func runShell(command *Command, args []string) bool {
util.LoadConfiguration("security", false)
shellOptions.GrpcDialOption = security.LoadClientTLS(util.GetViper(), "grpc.client")
- var filerPwdErr error
- shellOptions.FilerHost, shellOptions.FilerPort, shellOptions.Directory, filerPwdErr = util.ParseFilerUrl(*shellInitialFilerUrl)
- if filerPwdErr != nil {
- fmt.Printf("failed to parse url filer.url=%s : %v\n", *shellInitialFilerUrl, filerPwdErr)
+ var err error
+ shellOptions.FilerHost, shellOptions.FilerPort, err = util.ParseHostPort(*shellInitialFiler)
+ if err != nil {
+ fmt.Printf("failed to parse filer %s: %v\n", *shellInitialFiler, err)
return false
}
+ shellOptions.Directory = "/"
shell.RunShell(shellOptions)