aboutsummaryrefslogtreecommitdiff
path: root/weed/shell/command_cluster_check.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-04-04 14:48:00 -0700
committerchrislu <chris.lu@gmail.com>2022-04-04 14:48:00 -0700
commit4aae87f40510dc67762dca150d0d61be3a7dc8d7 (patch)
tree0c2f1fc46ed3cb5bcf2c04270379411ba557d4d0 /weed/shell/command_cluster_check.go
parentd310711de0658ebd402a525e8c0dc40339fc6fc0 (diff)
downloadseaweedfs-4aae87f40510dc67762dca150d0d61be3a7dc8d7.tar.xz
seaweedfs-4aae87f40510dc67762dca150d0d61be3a7dc8d7.zip
check missing hdd disk type
Diffstat (limited to 'weed/shell/command_cluster_check.go')
-rw-r--r--weed/shell/command_cluster_check.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.go
index a050c3f12..f841bd224 100644
--- a/weed/shell/command_cluster_check.go
+++ b/weed/shell/command_cluster_check.go
@@ -39,6 +39,19 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i
return nil
}
+ // collect topology information
+ topologyInfo, volumeSizeLimitMb, err := collectTopologyInfo(commandEnv, 0)
+ if err != nil {
+ return err
+ }
+ fmt.Fprintf(writer, "Topology volumeSizeLimit:%d MB%s\n", volumeSizeLimitMb, diskInfosToString(topologyInfo.DiskInfos))
+
+ emptyDiskTypeDiskInfo, emptyDiskTypeFound := topologyInfo.DiskInfos[""]
+ hddDiskTypeDiskInfo, hddDiskTypeFound := topologyInfo.DiskInfos["hdd"]
+ if !emptyDiskTypeFound && !hddDiskTypeFound || emptyDiskTypeDiskInfo.VolumeCount == 0 && hddDiskTypeDiskInfo.VolumeCount == 0 {
+ return fmt.Errorf("Need to a hdd disk type!")
+ }
+
// collect filers
var filers []pb.ServerAddress
err = commandEnv.MasterClient.WithClient(false, func(client master_pb.SeaweedClient) error {