aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-05-01 21:59:16 -0700
committerchrislu <chris.lu@gmail.com>2022-05-01 21:59:16 -0700
commit94635e9b5c81d6afa1b54f20f5d2d2595bba2322 (patch)
tree9e6eb799c480603598b020e4f6cdddaa21f555af /weed/shell
parent4bd6bea4295cd238278b20f18a15664fa3465008 (diff)
downloadseaweedfs-94635e9b5c81d6afa1b54f20f5d2d2595bba2322.tar.xz
seaweedfs-94635e9b5c81d6afa1b54f20f5d2d2595bba2322.zip
filer: add filer group
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