feat(blobnode): supports mounting meta directories separately for each disk

@formatter:off

Signed-off-by: yuzhiqiang <yuzhiqiang_yewu@cmss.chinamobile.com>
This commit is contained in:
yuzhiqiang 2025-10-24 14:45:03 +08:00 committed by 梁曟風
parent 199a945da0
commit ed09c33f3b
4 changed files with 24 additions and 8 deletions

View File

@ -84,6 +84,7 @@ type RuntimeConfig struct {
AllowCleanTrash bool `json:"allow_clean_trash"`
DisableModifyInCompacting bool `json:"disable_modify_in_compacting"`
MustMountPoint bool `json:"must_mount_point"`
MustMountPointMeta bool `json:"must_mount_point_meta"`
IOStatFileDryRun bool `json:"iostat_file_dryrun"`
SetDefaultSwitch bool `json:"set_default_switch"`
EnableDeleteShardVerify bool `json:"enable_delete_shard_verify"`

View File

@ -949,13 +949,26 @@ func newDiskStorage(ctx context.Context, conf core.Config) (ds *DiskStorage, err
if conf.MustMountPoint {
if !myos.IsMountPoint(conf.Path) {
span.Errorf("%s must mount point.", conf.Path)
return nil, errors.New("must mount point")
span.Errorf("%s must be a mount point.", conf.Path)
return nil, errors.New("must be a mount point")
}
}
// If metaRoot is not configured, the meta directory will be
// created under conf.Path, no need to check.
if metaRoot != "" {
// First check whether the metadata space is mounted separately for each disk,
// and then check whether the metadata space is mounted together for all disks.
checkPath := ""
if conf.MustMountPointMeta {
checkPath = filepath.Join(metaRoot, path)
} else if conf.MustMountPoint {
checkPath = metaRoot
}
if metaRoot != "" && !myos.IsMountPoint(metaRoot) {
span.Errorf("%s must mount point.", metaRoot)
return nil, errors.New("must mount point")
if checkPath != "" && !myos.IsMountPoint(checkPath) {
span.Errorf("%s must be a mount point.", checkPath)
return nil, errors.New("must be a mount point")
}
}

View File

@ -67,6 +67,7 @@ BlobNode的配置是基于[公有配置](./base.md),以下配置说明主要
"metric_report_interval_S": "metric上报的定时任务周期",
"set_default_switch": "是否默认设置开关.建议该项填true,会设置need_compact_check,allow_force_compact,allow_clean_trash",
"must_mount_point": "数据存放目录是否强制是挂载点",
"must_mount_point_meta": "如果配置了 meta_root_prefix开启 must_mount_point_meta 后会检查每个磁盘的元数据目录是否为挂载点,默认值 false",
"write_thread_cnt": "限制写线程个数, 默认值4",
"read_thread_cnt": "限制读线程个数, 默认值4",
"delete_thread_cnt": "限制删线程个数, 默认值1",

View File

@ -68,9 +68,10 @@ BlobNode configuration is based on the [public configuration](./base.md), and th
"metric_report_interval_S": "interval for metric reporting",
"set_default_switch": "whether to set switch.suggest you set it to true,will set: need_compact_check,allow_force_compact,allow_clean_trash",
"must_mount_point": "whether the data storage directory must be a mount point",
"write_thread_cnt": "limit the number of write threadsdefault 4",
"read_thread_cnt": "limit the number of read threadsdefault 4",
"delete_thread_cnt": "limit the number of delete threadsdefault 1",
"must_mount_point_meta": "if meta_root_prefix is configured, turning on must_mount_point_meta will check if the metadata directory of each disk is a mount point, default false",
"write_thread_cnt": "limit the number of write threads, default 4",
"read_thread_cnt": "limit the number of read threads, default 4",
"delete_thread_cnt": "limit the number of delete threads, default 1",
"data_qos": {
"read_mbps": "per disk normal read IO bandwidth",
"write_mbps": "per disk normal write IO bandwidth",