SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add command to list filers
Chris Lu314c32514b11
diff --git a/weed/shell/command_cluster_ps.go b/weed/shell/command_cluster_ps.gonew file mode 100644index 0000000000..ff92064db8--- /dev/null+++ b/weed/shell/command_cluster_ps.go@@ -0,0 +1,54 @@+package shell++import (+ "context"+ "flag"+ "fmt"+ "io"++ "github.com/chrislusf/seaweedfs/weed/pb/master_pb"+)++func init() {+ Commands = append(Commands, &commandClusterPs{})+}++type commandClusterPs struct {+}++func (c *commandClusterPs) Name() string {+ return "cluster.ps"+}++func (c *commandClusterPs) Help() string {+ return `check current cluster process status++ cluster.ps++`+}++func (c *commandClusterPs) Do(args []string, commandEnv *CommandEnv, writer io.Writer) (err error) {++ clusterPsCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)+ if err = clusterPsCommand.Parse(args); err != nil {+ return nil+ }++ err = commandEnv.MasterClient.WithClient(func(client master_pb.SeaweedClient) error {+ resp, err := client.ListClusterNodes(context.Background(), &master_pb.ListClusterNodesRequest{+ ClientType: "filer",+ })++ fmt.Fprintf(writer, "the cluster has %d filers\n", len(resp.ClusterNodes))+ for _, node := range resp.ClusterNodes {+ fmt.Fprintf(writer, " * %s (%v)\n", node.Address, node.Version)+ }+ return err+ })+ if err != nil {+ return+ }++ return nil+}