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"
}
参考: