diff options
Diffstat (limited to 'weed/shell/command_cluster_ps.go')
| -rw-r--r-- | weed/shell/command_cluster_ps.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/weed/shell/command_cluster_ps.go b/weed/shell/command_cluster_ps.go index 21d3587fb..fc5f801b1 100644 --- a/weed/shell/command_cluster_ps.go +++ b/weed/shell/command_cluster_ps.go @@ -40,7 +40,9 @@ func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.W } var filerNodes []*master_pb.ListClusterNodesResponse_ClusterNode + var mqBrokerNodes []*master_pb.ListClusterNodesResponse_ClusterNode + // get the list of filers err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error { resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{ ClientType: cluster.FilerType, @@ -57,6 +59,30 @@ func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.W return } + // get the list of message queue brokers + err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error { + resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{ + ClientType: cluster.BrokerType, + FilerGroup: *commandEnv.option.FilerGroup, + }) + if err != nil { + return err + } + + mqBrokerNodes = resp.ClusterNodes + return err + }) + if err != nil { + return + } + + if len(mqBrokerNodes) > 0 { + fmt.Fprintf(writer, "* message queue brokers %d\n", len(mqBrokerNodes)) + for _, node := range mqBrokerNodes { + fmt.Fprintf(writer, " * %s (%v)\n", node.Address, node.Version) + } + } + fmt.Fprintf(writer, "* filers %d\n", len(filerNodes)) for _, node := range filerNodes { fmt.Fprintf(writer, " * %s (%v)\n", node.Address, node.Version) |
