From 4aae87f40510dc67762dca150d0d61be3a7dc8d7 Mon Sep 17 00:00:00 2001 From: chrislu Date: Mon, 4 Apr 2022 14:48:00 -0700 Subject: [PATCH] check missing hdd disk type --- weed/shell/command_cluster_check.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 {