aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-05-03 00:13:57 +0500
committerKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-05-03 00:13:57 +0500
commitd8925b4e832b9ed12deae0b9b94cd5f050f2f258 (patch)
treea197c8619048285e87c89932666ec0c7b2434f40 /weed/shell
parent7640e650e5e647e6d6f3c8043c1e0a7442f154c7 (diff)
parent998c1973eae6cbf5f91a80d3d6a864db91a3d38f (diff)
downloadseaweedfs-d8925b4e832b9ed12deae0b9b94cd5f050f2f258.tar.xz
seaweedfs-d8925b4e832b9ed12deae0b9b94cd5f050f2f258.zip
Merge branch 'new_master' into ydb
# Conflicts: # go.mod # go.sum
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_cluster_check.go1
-rw-r--r--weed/shell/command_cluster_ps.go1
-rw-r--r--weed/shell/commands.go3
-rw-r--r--weed/shell/shell_liner.go1
4 files changed, 5 insertions, 1 deletions
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go
index 616669b6d..2ab82fca2 100644
--- a/weed/shell/command_cluster_check.go
+++ b/weed/shell/command_cluster_check.go
@@ -59,6 +59,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i
err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {
resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{
ClientType: cluster.FilerType,
+ FilerGroup: *commandEnv.option.FilerGroup,
})
for _, node := range resp.ClusterNodes {
diff --git a/weed/shell/command_cluster_ps.go b/weed/shell/command_cluster_ps.go
index 2d391de1d..72f477607 100644
--- a/weed/shell/command_cluster_ps.go
+++ b/weed/shell/command_cluster_ps.go
@@ -39,6 +39,7 @@ func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.W
err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {
resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{
ClientType: cluster.FilerType,
+ FilerGroup: *commandEnv.option.FilerGroup,
})
fmt.Fprintf(writer, "the cluster has %d filers\n", len(resp.ClusterNodes))
diff --git a/weed/shell/commands.go b/weed/shell/commands.go
index 3ff49f1d2..08f639d34 100644
--- a/weed/shell/commands.go
+++ b/weed/shell/commands.go
@@ -22,6 +22,7 @@ type ShellOptions struct {
// shell transient context
FilerHost string
FilerPort int64
+ FilerGroup *string
FilerAddress pb.ServerAddress
Directory string
}
@@ -46,7 +47,7 @@ var (
func NewCommandEnv(options *ShellOptions) *CommandEnv {
ce := &CommandEnv{
env: make(map[string]string),
- MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, pb.AdminShellClient, "", "", pb.ServerAddresses(*options.Masters).ToAddressMap()),
+ MasterClient: wdclient.NewMasterClient(options.GrpcDialOption, *options.FilerGroup, pb.AdminShellClient, "", "", pb.ServerAddresses(*options.Masters).ToAddressMap()),
option: options,
}
ce.locker = exclusive_locks.NewExclusiveLocker(ce.MasterClient, "admin")
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go
index 94a68f5bc..595dbf679 100644
--- a/weed/shell/shell_liner.go
+++ b/weed/shell/shell_liner.go
@@ -54,6 +54,7 @@ func RunShell(options ShellOptions) {
commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {
resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{
ClientType: cluster.FilerType,
+ FilerGroup: *options.FilerGroup,
})
if err != nil {
return err