aboutsummaryrefslogtreecommitdiff
path: root/weed/command/shell.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-11-02 23:38:45 -0700
committerChris Lu <chris.lu@gmail.com>2021-11-02 23:38:45 -0700
commit5160eb08f7665409221ebb0b9db6f4820e29bed3 (patch)
treef63464dd23ee0742bd96afe52826b477a775dc5e /weed/command/shell.go
parent18bfbf62fcc64be380293ce797ab23f785c01760 (diff)
downloadseaweedfs-5160eb08f7665409221ebb0b9db6f4820e29bed3.tar.xz
seaweedfs-5160eb08f7665409221ebb0b9db6f4820e29bed3.zip
shell: optionally read filer address from master
Diffstat (limited to 'weed/command/shell.go')
-rw-r--r--weed/command/shell.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/weed/command/shell.go b/weed/command/shell.go
index 93bb69522..15c12f556 100644
--- a/weed/command/shell.go
+++ b/weed/command/shell.go
@@ -37,7 +37,7 @@ func runShell(command *Command, args []string) bool {
util.LoadConfiguration("security", false)
shellOptions.GrpcDialOption = security.LoadClientTLS(util.GetViper(), "grpc.client")
- if *shellOptions.Masters == "" && *shellInitialFiler == "" {
+ if *shellOptions.Masters == "" {
util.LoadConfiguration("shell", false)
v := util.GetViper()
cluster := v.GetString("cluster.default")
@@ -45,15 +45,16 @@ func runShell(command *Command, args []string) bool {
cluster = *shellCluster
}
if cluster == "" {
- *shellOptions.Masters, *shellInitialFiler = "localhost:9333", "localhost:8888"
+ *shellOptions.Masters = "localhost:9333"
+ fmt.Printf("master: %s\n", *shellOptions.Masters)
+
} else {
*shellOptions.Masters = v.GetString("cluster." + cluster + ".master")
*shellInitialFiler = v.GetString("cluster." + cluster + ".filer")
+ fmt.Printf("master: %s filer: %s\n", *shellOptions.Masters, *shellInitialFiler)
}
}
- fmt.Printf("master: %s filer: %s\n", *shellOptions.Masters, *shellInitialFiler)
-
shellOptions.FilerAddress = pb.ServerAddress(*shellInitialFiler)
shellOptions.Directory = "/"