diff options
| author | yulai.li <blacktear23@gmail.com> | 2022-06-26 22:43:37 +0800 |
|---|---|---|
| committer | yulai.li <blacktear23@gmail.com> | 2022-06-26 22:43:37 +0800 |
| commit | 46e0b629e529f3aff535f90dd25eb719adf1c0d0 (patch) | |
| tree | 734125b48b6d96f8796a2b89b924312cd169ef0e /weed/command/shell.go | |
| parent | a5bd0b3a1644a77dcc0b9ff41c4ce8eb3ea0d566 (diff) | |
| parent | dc59ccd110a321db7d0b0480631aa95a3d9ba7e6 (diff) | |
| download | seaweedfs-46e0b629e529f3aff535f90dd25eb719adf1c0d0.tar.xz seaweedfs-46e0b629e529f3aff535f90dd25eb719adf1c0d0.zip | |
Update tikv client version and add one PC support
Diffstat (limited to 'weed/command/shell.go')
| -rw-r--r-- | weed/command/shell.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/weed/command/shell.go b/weed/command/shell.go index 4a9f4b027..c32a8e614 100644 --- a/weed/command/shell.go +++ b/weed/command/shell.go @@ -2,6 +2,7 @@ package command import ( "fmt" + "github.com/chrislusf/seaweedfs/weed/pb" "github.com/chrislusf/seaweedfs/weed/security" "github.com/chrislusf/seaweedfs/weed/shell" @@ -17,6 +18,7 @@ var ( func init() { cmdShell.Run = runShell // break init cycle shellOptions.Masters = cmdShell.Flag.String("master", "", "comma-separated master servers, e.g. localhost:9333") + shellOptions.FilerGroup = cmdShell.Flag.String("filerGroup", "", "filerGroup for the filers") shellInitialFiler = cmdShell.Flag.String("filer", "", "filer host and port, e.g. localhost:8888") shellCluster = cmdShell.Flag.String("cluster", "", "cluster defined in shell.toml") } @@ -36,7 +38,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") @@ -44,22 +46,15 @@ func runShell(command *Command, args []string) bool { cluster = *shellCluster } if cluster == "" { - *shellOptions.Masters, *shellInitialFiler = "localhost:9333", "localhost:8888" + *shellOptions.Masters = "localhost:9333" } 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) - - var err error - shellOptions.FilerHost, shellOptions.FilerPort, err = util.ParseHostPort(*shellInitialFiler) - shellOptions.FilerAddress = *shellInitialFiler - if err != nil { - fmt.Printf("failed to parse filer %s: %v\n", *shellInitialFiler, err) - return false - } + shellOptions.FilerAddress = pb.ServerAddress(*shellInitialFiler) shellOptions.Directory = "/" shell.RunShell(shellOptions) |
