ceph 调整 PG 平衡 集群数据分布自动进行调整

ceph 调整 PG 平衡 集群数据分布自动进行调整

ceph 调整 PG 平衡

# ceph -v
ceph version 13.2.10 mimic (stable)
ceph mgr module ls
# ceph mgr module ls
{
    "enabled_modules": [
        "balancer",
        "crash",
        "dashboard",
        "iostat",
        "restful",
        "status"
    ],
    "disabled_modules": [
        {
            "name": "hello",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "influx",
            "can_run": false,
            "error_string": "influxdb python module not found"
        },
        {
            "name": "localpool",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "prometheus",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "selftest",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "smart",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "telegraf",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "telemetry",
            "can_run": true,
            "error_string": ""
        },
        {
            "name": "zabbix",
            "can_run": true,
            "error_string": ""
        }
    ]
}
ceph  balancer status
# ceph  balancer status
{
    "last_optimize_duration": "",
    "plans": [],
    "mode": "none",
    "active": false,
    "optimize_result": "",
    "last_optimize_started": ""
}

crush-compat 模式

ceph balancer mode crush-compat
  • 开启调整
ceph balancer on
# ceph  balancer status
{
    "last_optimize_duration": "0:00:01.007712",
    "plans": [],
    "mode": "crush-compat",
    "active": true,
    "optimize_result": "Optimization plan created successfully",
    "last_optimize_started": "Sat Jan  2 10:51:55 2021"
}
# ceph -s
    health: HEALTH_WARN
            7519146/149867787 objects misplaced (5.017%)

调整完成

# ceph  balancer status
{
    "last_optimize_duration": "0:00:01.314594",
    "plans": [],
    "mode": "crush-compat",
    "active": true,
    "optimize_result": "Unable to find further optimization, change balancer mode and retry might help",
    "last_optimize_started": "Sun Jan  3 09:40:34 2021"
}

关闭自动平衡

# ceph balancer off
# ceph  balancer status
{
    "last_optimize_duration": "0:00:01.315186",
    "plans": [],
    "mode": "crush-compat",
    "active": false,
    "optimize_result": "Unable to find further optimization, change balancer mode and retry might help",
    "last_optimize_started": "Sun Jan  3 09:42:38 2021"
}

参考:

  1. ceph的pg平衡插件balancer
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值