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
weed/shell: Cluster check other disk types (#5245)
Benoît Knecht56287bd07d22
diff --git a/weed/shell/command_cluster_check.go b/weed/shell/command_cluster_check.goindex 3fb72940f5..03acca5b28 100644--- a/weed/shell/command_cluster_check.go+++ b/weed/shell/command_cluster_check.go@@ -46,13 +46,13 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i}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 {- return fmt.Errorf("Need to a hdd disk type!")+ if len(topologyInfo.DiskInfos) == 0 {+ return fmt.Errorf("no disk type defined")}- if emptyDiskTypeFound && emptyDiskTypeDiskInfo.MaxVolumeCount == 0 || hddDiskTypeFound && hddDiskTypeDiskInfo.MaxVolumeCount == 0 {- return fmt.Errorf("Need to a hdd disk type!")+ for diskType, diskInfo := range topologyInfo.DiskInfos {+ if diskInfo.MaxVolumeCount == 0 {+ return fmt.Errorf("no volume available for \"%s\" disk type", diskType)+ }}// collect filers@@ -73,6 +73,19 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i}fmt.Fprintf(writer, "the cluster has %d filers: %+v\n", len(filers), filers)+ if len(filers) > 0 {+ genericDiskInfo, genericDiskInfoOk := topologyInfo.DiskInfos[""]+ hddDiskInfo, hddDiskInfoOk := topologyInfo.DiskInfos["hdd"]++ if !genericDiskInfoOk && !hddDiskInfoOk {+ return fmt.Errorf("filer metadata logs need generic or hdd disk type to be defined")+ }++ if (genericDiskInfoOk && genericDiskInfo.MaxVolumeCount == 0) || (hddDiskInfoOk && hddDiskInfo.MaxVolumeCount == 0) {+ return fmt.Errorf("filer metadata logs need generic or hdd volumes to be available")+ }+ }+// collect volume serversvar volumeServers []pb.ServerAddresst, _, err := collectTopologyInfo(commandEnv, 0)@@ -90,9 +103,7 @@ func (c *commandClusterCheck) Do(args []string, commandEnv *CommandEnv, writer i// collect all mastersvar masters []pb.ServerAddress- for _, master := range commandEnv.MasterClient.GetMasters() {- masters = append(masters, master)- }+ masters = append(masters, commandEnv.MasterClient.GetMasters()...)// check from master to volume serversfor _, master := range masters {