ceph实践

ceph实践

dump与show

bash 复制代码
[root@ceph1 ~ 10:54:12]# ceph config dump
WHO     MASK  LEVEL     OPTION                                 VALUE                                                                                      RO
global        basic     container_image                        quay.io/ceph/ceph@sha256:6ba107eb55617994a9e6ed49fb938828c2ed3121aa19ceeffbf8e28608535d94  *
  mon         advanced  auth_allow_insecure_global_id_reclaim  false                
  mon         advanced  public_network                         192.168.108.0/24                                                                           *
  mgr         advanced  mgr/cephadm/container_init             True                                                                                       *
  mgr         advanced  mgr/cephadm/migration_current          5                                                                                          *
  mgr         advanced  mgr/dashboard/ALERTMANAGER_API_HOST    http://ceph1.my.cloud:9093                                                                 *
  mgr         advanced  mgr/dashboard/GRAFANA_API_SSL_VERIFY   false                                                                                      *
  mgr         advanced  mgr/dashboard/GRAFANA_API_URL          https://ceph1.my.cloud:3000                                                                *
  mgr         advanced  mgr/dashboard/PROMETHEUS_API_HOST      http://ceph1.my.cloud:9095                                                                 *
  mgr         advanced  mgr/dashboard/ssl_server_port          8443                                                                                       *
  mgr         advanced  mgr/orchestrator/orchestrator          cephadm              
  osd         advanced  osd_memory_target_autotune             true                 
[root@ceph1 ~ 10:57:34]# ceph config show mon.ceph1.my.cloud
NAME                                   VALUE                                                                                                                                                        SOURCE    OVERRIDES                IGNORES
auth_allow_insecure_global_id_reclaim  false                                                                                                                                                        mon
container_image                        quay.io/ceph/ceph@sha256:6ba107eb55617994a9e6ed49fb938828c2ed3121aa19ceeffbf8e28608535d94                                                                    mon
daemonize                              false                                                                                                                                                        override
keyring                                $mon_data/keyring                                                                                                                                            default
leveldb_block_size                     65536                                                                                                                                                        default
leveldb_cache_size                     536870912                                                                                                                                                    default
leveldb_compression                    false                                                                                                                                                        default
leveldb_log                                                                                                                                                                                         default
leveldb_write_buffer_size              33554432                                                                                                                                                     default
log_stderr_prefix                      debug                                                                                                                                                        default
log_to_file                            false                                                                                                                                                        default
log_to_stderr                          true                                                                                                                                                         default
mon_cluster_log_to_file                false                                                                                                                                                        default
mon_cluster_log_to_stderr              true                                                                                                                                                         default
mon_host                               [v2:192.168.108.11:3300/0,v1:192.168.108.11:6789/0] [v2:192.168.108.12:3300/0,v1:192.168.108.12:6789/0] [v2:192.168.108.13:3300/0,v1:192.168.108.13:6789/0]  file
no_config_file                         false                                                                                                                                                        override
public_network                         192.168.108.0/24                                                                                                                                             file      (mon[192.168.108.0/24])
rbd_default_features                   61                                                                                                                                                           default
setgroup                               ceph                                                                                                                                                         cmdline
setuser                                ceph                                                                                                                                                         cmdline
[root@ceph1 ~ 10:57:59]# ceph config show mon.ceph1.my.cloud public_network
192.168.108.0/24

show-with-defaults与get

bash 复制代码
[root@ceph1 ~ 11:00:54]# ceph config get mon.ceph1.my.cloud
WHO     MASK  LEVEL     OPTION                                 VALUE                                                                                      RO
mon           advanced  auth_allow_insecure_global_id_reclaim  false                
global        basic     container_image                        quay.io/ceph/ceph@sha256:6ba107eb55617994a9e6ed49fb938828c2ed3121aa19ceeffbf8e28608535d94  *
mon           advanced  public_network                         192.168.108.0/24         [root@ceph1 ~ 11:01:11]# ceph config show-with-defaults mon.ceph1.my.cloud | wc -l
1809             

log

bash 复制代码
[root@ceph1 ~ 11:02:33]# ceph config log
--- 13 --- 2026-05-27T04:02:20.249254+0000 ---
+ mgr/mgr/dashboard/PROMETHEUS_API_HOST = http://ceph1.my.cloud:9095
--- 12 --- 2026-05-27T04:02:20.220408+0000 ---
+ mgr/mgr/dashboard/GRAFANA_API_URL = https://ceph1.my.cloud:3000
--- 11 --- 2026-05-27T04:02:20.182461+0000 ---
+ mgr/mgr/dashboard/ALERTMANAGER_API_HOST = http://ceph1.my.cloud:9093
--- 10 --- 2026-05-27T04:01:51.060229+0000 ---
+ mgr/mgr/dashboard/GRAFANA_API_SSL_VERIFY = false
--- 9 --- 2026-05-27T04:01:41.364821+0000 ---
- global/container_image = quay.io/ceph/ceph:v16
+ global/container_image = quay.io/ceph/ceph@sha256:6ba107eb55617994a9e6ed49fb938828c2ed3121aa19ceeffbf8e28608535d94
--- 8 --- 2026-05-27T04:01:40.595464+0000 ---
+ osd/osd_memory_target_autotune = true
--- 7 --- 2026-05-27T04:01:23.003830+0000 ---
+ mgr/mgr/dashboard/ssl_server_port = 8443
--- 6 --- 2026-05-27T04:01:22.081158+0000 ---
+ mgr/mgr/cephadm/container_init = True
--- 5 --- 2026-05-27T04:01:08.449816+0000 ---
+ mgr/mgr/orchestrator/orchestrator = cephadm
--- 4 --- 2026-05-27T04:01:06.371107+0000 ---
+ mgr/mgr/cephadm/migration_current = 5

reset回溯

bash 复制代码
[root@ceph1 ~ 11:34:51]# ceph config set mon.ceph1.my.cloud mon_allow_pool_delete true
[root@ceph1 ~ 11:36:16]# ceph config set mon.ceph1.my.cloud mon_allow_pool_delete false
[root@ceph1 ~ 11:36:43]# ceph  config log 2
--- 15 --- 2026-05-28T03:36:42.978820+0000 ---
- mon.ceph1.my.cloud/mon_allow_pool_delete = true
+ mon.ceph1.my.cloud/mon_allow_pool_delete = false
--- 14 --- 2026-05-28T03:36:16.846993+0000 ---
+ mon.ceph1.my.cloud/mon_allow_pool_delete = true
[root@ceph1 ~ 11:37:32]# ceph config log 14
--- 15 --- 2026-05-28T03:36:42.978820+0000 ---
- mon.ceph1.my.cloud/mon_allow_pool_delete = true
+ mon.ceph1.my.cloud/mon_allow_pool_delete = false
--- 14 --- 2026-05-28T03:36:16.846993+0000 ---
+ mon.ceph1.my.cloud/mon_allow_pool_delete = true
--- 13 --- 2026-05-27T04:02:20.249254+0000 ---
+ mgr/mgr/dashboard/PROMETHEUS_API_HOST = http://ceph1.my.cloud:9095
--- 12 --- 2026-05-27T04:02:20.220408+0000 ---
+ mgr/mgr/dashboard/GRAFANA_API_URL = https://ceph1.my.cloud:3000
--- 11 --- 2026-05-27T04:02:20.182461+0000 ---
+ mgr/mgr/dashboard/ALERTMANAGER_API_HOST = http://ceph1.my.cloud:9093
--- 10 --- 2026-05-27T04:01:51.060229+0000 ---
+ mgr/mgr/dashboard/GRAFANA_API_SSL_VERIFY = false
--- 9 --- 2026-05-27T04:01:41.364821+0000 ---
- global/container_image = quay.io/ceph/ceph:v16
+ global/container_image = quay.io/ceph/ceph@sha256:6ba107eb55617994a9e6ed49fb938828c2ed3121aa19ceeffbf8e28608535d94
--- 8 --- 2026-05-27T04:01:40.595464+0000 ---
+ osd/osd_memory_target_autotune = true
--- 7 --- 2026-05-27T04:01:23.003830+0000 ---
+ mgr/mgr/dashboard/ssl_server_port = 8443
--- 6 --- 2026-05-27T04:01:22.081158+0000 ---
+ mgr/mgr/cephadm/container_init = True
--- 5 --- 2026-05-27T04:01:08.449816+0000 ---
+ mgr/mgr/orchestrator/orchestrator = cephadm
--- 4 --- 2026-05-27T04:01:06.371107+0000 ---
+ mgr/mgr/cephadm/migration_current = 5
--- 3 --- 2026-05-27T04:00:41.004398+0000 ---
+ mon/public_network = 192.168.108.0/24
--- 2 --- 2026-05-27T04:00:38.049487+0000 ---
+ global/container_image = quay.io/ceph/ceph:v16
+ mon/auth_allow_insecure_global_id_reclaim = false
[root@ceph1 ~ 11:38:28]# ceph config log 1
--- 15 --- 2026-05-28T03:36:42.978820+0000 ---
- mon.ceph1.my.cloud/mon_allow_pool_delete = true
+ mon.ceph1.my.cloud/mon_allow_pool_delete = false

tell命令

bash 复制代码
[root@ceph1 ~ 11:41:36]# ceph tell mon.ceph1.my.cloud config get mon_allow_pool_delete
{
    "mon_allow_pool_delete": "false"
}
[root@ceph1 ~ 11:43:06]# ceph tell mon.ceph1.my.cloud config set mon_allow_pool_delete true
{
    "success": "mon_allow_pool_delete = 'true' "
}
[root@ceph1 ~ 11:43:23]# ceph tell mon.ceph1.my.cloud config get mon_allow_pool_delete
{
    "mon_allow_pool_delete": "true"
}
[root@ceph1 ~ 11:44:23]# ceph orch daemon restart mon.ceph1.my.cloud
Scheduled to restart mon.ceph1.my.cloud on host 'ceph1.my.cloud'
[root@ceph1 ~ 11:45:23]# ceph tell mon.ceph1.my.cloud config get mon_allow_pool_delete
{
"mon_allow_pool_delete": "true"
}
[root@ceph1 ~]# ceph tell mon.* config get mon_allow_pool_delete
mon.ceph1.my.cloud: {
"mon_allow_pool_delete": "true"
}
mon.ceph2: {
"mon_allow_pool_delete": "false"
}
mon.ceph3: {
"mon_allow_pool_delete": "false"
}

daemon命令

bash 复制代码
[root@ceph1 ~]# cephadm shell
[ceph: root@ceph1 /]# ceph daemon mon.ceph1.my.cloud config get mon_allow_pool_delete
{
    "mon_allow_pool_delete": "true"
}
[ceph: root@ceph1 /]# ceph daemon mon.ceph1.my.cloud config set mon_allow_pool_delete false
{
    "success": "mon_allow_pool_delete = 'false' "
}
[ceph: root@ceph1 /]# ceph daemon mon.ceph1.my.cloud config get mon_allow_pool_delete
{
    "mon_allow_pool_delete": "false"
}
[ceph: root@ceph1 /]# ceph orch daemon restart mon.ceph1.my.cloud
Scheduled to restart mon.ceph1.my.cloud on host 'ceph1.my.cloud'
[ceph: root@ceph1 /]# ceph daemon mon.ceph1.my.cloud config get mon_allow_pool_delete
{
    "mon_allow_pool_delete": "false"
}

集群监控器monitor

bash 复制代码
[root@ceph1 ~ 14:26:06]# ceph status | grep mon
    mon: 3 daemons, quorum ceph1.my.cloud,ceph3,ceph2 (age 116m)
[root@ceph1 ~ 14:29:51]# ceph mon stat
e5: 3 mons at {ceph1.my.cloud=[v2:192.168.108.11:3300/0,v1:192.168.108.11:6789/0],ceph2=[v2:192.168.108.12:3300/0,v1:192.168.108.12:6789/0],ceph3=[v2:192.168.108.13:3300/0,v1:192.168.108.13:6789/0]} removed_ranks: {}, election epoch 74, leader 0 ceph1.my.cloud, quorum 0,1,2 ceph1.my.cloud,ceph3,ceph2
[root@ceph1 ~ 14:30:08]# ceph quorum_status -f json-pretty

{
    "election_epoch": 74,
    "quorum": [
        0,
        1,
        2
    ],
    "quorum_names": [
        "ceph1.my.cloud",
        "ceph3",
        "ceph2"
    ],
    "quorum_leader_name": "ceph1.my.cloud",
    "quorum_age": 7058,
    "features": {
        "quorum_con": "4540138314316775423",
        "quorum_mon": [
            "kraken",
            "luminous",
            "mimic",
            "osdmap-prune",
            "nautilus",
            "octopus",
            "pacific",
            "elector-pinging"
        ]
    },
    "monmap": {
        "epoch": 5,
        "fsid": "96b28050-5980-11f1-8411-000c2993506d",
        "modified": "2026-05-27T08:20:42.102948Z",
        "created": "2026-05-27T04:00:34.749000Z",
        "min_mon_release": 16,
        "min_mon_release_name": "pacific",
        "election_strategy": 1,
        "disallowed_leaders: ": "",
        "stretch_mode": false,
        "tiebreaker_mon": "",
        "removed_ranks: ": "",
        "features": {
            "persistent": [
                "kraken",
                "luminous",
                "mimic",
                "osdmap-prune",
                "nautilus",
                "octopus",
                "pacific",
                "elector-pinging"
            ],
            "optional": []
        },
        "mons": [
            {
                "rank": 0,
                "name": "ceph1.my.cloud",
                "public_addrs": {
                    "addrvec": [
                        {
                            "type": "v2",
                            "addr": "192.168.108.11:3300",
                            "nonce": 0
                        },
                        {
                            "type": "v1",
                            "addr": "192.168.108.11:6789",
                            "nonce": 0
                        }
                    ]
                },
                "addr": "192.168.108.11:6789/0",
                "public_addr": "192.168.108.11:6789/0",
                "priority": 0,
                "weight": 0,
                "crush_location": "{}"
            },
            {
                "rank": 1,
                "name": "ceph3",
                "public_addrs": {
                    "addrvec": [
                        {
                            "type": "v2",
                            "addr": "192.168.108.13:3300",
                            "nonce": 0
                        },
                        {
                            "type": "v1",
                            "addr": "192.168.108.13:6789",
                            "nonce": 0
                        }
                    ]
                },
                "addr": "192.168.108.13:6789/0",
                "public_addr": "192.168.108.13:6789/0",
                "priority": 0,
                "weight": 0,
                "crush_location": "{}"
            },
            {
                "rank": 2,
                "name": "ceph2",
                "public_addrs": {
                    "addrvec": [
                        {
                            "type": "v2",
                            "addr": "192.168.108.12:3300",
                            "nonce": 0
                        },
                        {
                            "type": "v1",
                            "addr": "192.168.108.12:6789",
                            "nonce": 0
                        }
                    ]
                },
                "addr": "192.168.108.12:6789/0",
                "public_addr": "192.168.108.12:6789/0",
                "priority": 0,
                "weight": 0,
                "crush_location": "{}"
            }
        ]
    }
}
[root@ceph1 ~ 14:30:49]# ceph mon dump
epoch 5
fsid 96b28050-5980-11f1-8411-000c2993506d
last_changed 2026-05-27T08:20:42.102948+0000
created 2026-05-27T04:00:34.749000+0000
min_mon_release 16 (pacific)
election_strategy: 1
0: [v2:192.168.108.11:3300/0,v1:192.168.108.11:6789/0] mon.ceph1.my.cloud
1: [v2:192.168.108.13:3300/0,v1:192.168.108.13:6789/0] mon.ceph3
2: [v2:192.168.108.12:3300/0,v1:192.168.108.12:6789/0] mon.ceph2
dumped monmap epoch 5

创建复本池语法:

ceph osd pool create pool-name pg-num pgp-num replicated crush-rule-name

其中:

pool_name,指定新池的名称。

pg_num,指定池的放置组 (PG) 总数。

pgp_num,指定池的有效放置组数量。将它设置为与 pg_num 相等。该值可省略。

replicated ,指定池的类型为复本池;如果命令中未包含此参数,这是默认值。

crush-rule-name,指定池的 CRUSH 规则集的名称

bash 复制代码
[root@ceph1 ~ 14:32:49]# ceph osd pool create pool_web 32 32 replicated
pool 'pool_web' created
[root@ceph1 ~ 15:23:25]# ceph osd pool ls
device_health_metrics
pool_web

创建纠删代码池语法:

ceph osd pool create pool-name pg-num pgp-num erasure erasure-code-profile crush

rule-name

pool-name,指定新池的名称。

pg-num,指定池的放置组 (PG) 总数。

pgp-num,指定池的有效放置组数量。通常而言,这应当与 PG 总数相等。

erasure,指定池的类型是纠删代码池。

erasure-code-profile,指定池使用的纠删代码配置文件的名称。默认情况下,Ceph 使用 default

配置文件。crush-rule-name 是要用于这个池的 CRUSH 规则集的名称。如果不设置,Ceph 将使用纠删代码

池配置文件中定义的规则集。

bash 复制代码
[root@ceph1 ~ 15:23:58]# ceph osd pool create pool_era 32 32 erasure
pool 'pool_era' created
[root@ceph1 ~ 15:25:11]# ceph osd pool ls
device_health_metrics
pool_web
pool_era
[root@ceph1 ~ 15:25:17]# ceph osd erasure-code-profile ls
default
[root@ceph1 ~ 15:25:23]# ceph osd erasure-code-profile get default
k=2
m=2
plugin=jerasure
technique=reed_sol_van

创建纠删代码配置文件语法如下:

ceph osd erasure-code-profile set profile-name arguments

可用的参数如下:

k,在不同 OSD 之间拆分的数据区块数量。默认值为 2。

m,数据变得不可用之前可以出现故障的 OSD 数量。默认值为 1。

directory,此可选参数是插件库的位置。默认值为 /usr/lib64/ceph/erasure-code。

plugin,此可选参数定义要使用的纠删代码算法。

crush-failure-domain,此可选参数定义 CRUSH 故障域,它控制区块放置。默认设置为 host,

这样可确保对象的区块放置到不同主机的 OSD 上。如果设置为 osd,则对象的区块可以放置到同一

主机的 OSD 上。如果主机出现故障,则该主机上的所有 OSD 都会出现故障。故障域可用于确保将

区块放置到不同数据中心机架或其他定制的主机上的 OSD 上。

crush-device-class,此可选参数选择仅将这一类别设备支持的 OSD 用于池。典型的类别可能包

括 hdd、ssd 或nvme。

crush-root,此可选参数设置 CRUSH 规则集的根节点。

key=value,插件可以具有对该插件唯一的键值参数。

technique,每个插件提供一组不同的技术来实施不同的算法。

查看 池 状态

bash 复制代码
#池清单与配置
[root@ceph1 ~ 15:25:31]# ceph osd pool ls detail
pool 1 'device_health_metrics' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 1 pgp_num 1 autoscale_mode on last_change 61 flags hashpspool stripe_width 0 pg_num_max 32 pg_num_min 1 application mgr_devicehealth
pool 2 'pool_web' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 71 flags hashpspool stripe_width 0
pool 3 'pool_era' erasure profile default size 4 min_size 3 crush_rule 1 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 75 flags hashpspool stripe_width 8192
#列出池清单
[root@ceph1 ~ 15:28:18]# ceph osd lspools
1 device_health_metrics
2 pool_web
3 pool_era
#查看池被谁用
[root@ceph1 ~ 15:28:29]# ceph osd pool stats
pool device_health_metrics id 1
  nothing is going on

pool pool_web id 2
  nothing is going on

pool pool_era id 3
  nothing is going on
#查看池容量
[root@ceph1 ~ 15:28:40]# ceph df
--- RAW STORAGE ---
CLASS     SIZE    AVAIL     USED  RAW USED  %RAW USED
ssd    120 GiB  118 GiB  1.7 GiB   1.7 GiB       1.42
TOTAL  120 GiB  118 GiB  1.7 GiB   1.7 GiB       1.42

--- POOLS ---
POOL                   ID  PGS  STORED  OBJECTS  USED  %USED  MAX AVAIL
device_health_metrics   1    1     0 B        0   0 B      0     50 GiB
pool_web                2   32     0 B        0   0 B      0     50 GiB
pool_era                3   32     0 B        0   0 B      0     75 GiB

管理池

管理池应用类型

bash 复制代码
[root@ceph1 ~ 16:23:27]# ceph osd pool application enable pool_web rbd
enabled application 'rbd' on pool 'pool_web'
[root@ceph1 ~ 16:24:55]# ceph osd pool ls detail | grep pool_web
pool 2 'pool_web' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 79 flags hashpspool stripe_width 0 application rbd
[root@ceph1 ~ 16:25:05]# ceph osd pool application set pool_web rbd app1 apache
set application 'rbd' key 'app1' to 'apache' on pool 'pool_web'
[root@ceph1 ~ 16:25:43]# ceph osd pool application get pool_web
{
    "rbd": {
        "app1": "apache"
    }
}
[root@ceph1 ~ 16:26:02]# ceph osd pool application rm pool_web rbd app1
removed application 'rbd' key 'app1' on pool 'pool_web'
[root@ceph1 ~ 16:26:19]# ceph osd pool application get pool_web
{
    "rbd": {}
}
[root@ceph1 ~ 16:26:30]# ceph osd pool application disable pool_web rbd --yes-i-really-mean-it
disable application 'rbd' on pool 'pool_web'
[root@ceph1 ~ 16:27:06]# ceph osd pool ls detail | grep pool_web
pool 2 'pool_web' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 32 pgp_num 32 autoscale_mode on last_change 82 flags hashpspool stripe_width 0

管理池配额

bash 复制代码
[root@ceph1 ~ 16:27:24]# ceph osd pool get-quota pool_web
quotas for pool 'pool_web':
  max objects: N/A
  max bytes  : N/A
[root@ceph1 ~ 16:29:44]# ceph osd pool set-quota pool_web max_objects 100000
set-quota max_objects = 100000 for pool pool_web
[root@ceph1 ~ 16:30:02]# ceph osd pool set-quota pool_web max_bytes 10G
set-quota max_bytes = 10737418240 for pool pool_web
[root@ceph1 ~ 16:30:12]# ceph osd pool get-quota pool_web
quotas for pool 'pool_web':
  max objects: 100k objects  (current num objects: 0 objects)
  max bytes  : 10 GiB  (current num bytes: 0 bytes)
[root@ceph1 ~ 16:30:21]# ceph osd pool set-quota pool_web max_objects 0
set-quota max_objects = 0 for pool pool_web
[root@ceph1 ~ 16:30:30]# ceph osd pool set-quota pool_web max_bytes 0
set-quota max_bytes = 0 for pool pool_web
[root@ceph1 ~ 16:30:38]# ceph osd pool get-quota pool_web
quotas for pool 'pool_web':
  max objects: N/A
  max bytes  : N/A

管理池配置

bash 复制代码
[root@ceph1 ~ 16:30:47]# ceph osd pool get pool_web all
size: 3
min_size: 2
pg_num: 32
pgp_num: 32
crush_rule: replicated_rule
hashpspool: true
nodelete: false
nopgchange: false
nosizechange: false
write_fadvise_dontneed: false
noscrub: false

设置池配置

bash 复制代码
[root@ceph1 ~ 16:31:36]# ceph osd pool set pool_web nodelete true
set pool 2 nodelete to true
[root@ceph1 ~ 16:34:51]# ceph osd pool get pool_web nodelete
nodelete: true
[root@ceph1 ~ 16:35:07]# ceph osd pool set pool_web nodelete false
set pool 2 nodelete to false
[root@ceph1 ~ 16:35:23]# ceph osd pool get pool_web nodelete
nodelete: false

管理池副本数

bash 复制代码
[root@ceph1 ~ 16:35:07]# ceph osd pool set pool_web nodelete false
set pool 2 nodelete to false
[root@ceph1 ~ 16:35:23]# ceph osd pool get pool_web nodelete
nodelete: false
[root@ceph1 ~ 16:35:27]# ceph osd pool set pool_web size 2
set pool 2 size to 2
[root@ceph1 ~ 16:36:04]# ceph osd pool get pool_web all
size: 2
min_size: 1
pg_num: 32
pgp_num: 32
crush_rule: replicated_rule
hashpspool: true
nodelete: false
nopgchange: false
nosizechange: false
write_fadvise_dontneed: false
noscrub: false
nodeep-scrub: false
use_gmt_hitset: 1
fast_read: 0
pg_autoscale_mode: on
bulk: false
[root@ceph1 ~ 16:36:35]# ceph config get mon osd_pool_default_size
3
[root@ceph1 ~ 16:36:50]# ceph config set mon osd_pool_default_size 2
[root@ceph1 ~ 16:37:20]# ceph config get mon osd_pool_default_size
2
[root@ceph1 ~ 16:37:25]# ceph config get mon osd_pool_default_min_size
0
[root@ceph1 ~ 16:37:43]# ceph config set mon osd_pool_default_min_size 1
[root@ceph1 ~ 16:37:55]# ceph config get mon osd_pool_default_min_size
1

管理池PG数

bash 复制代码
[root@ceph1 ~ 16:37:59]# ceph osd pool set pool_web pg_num 64
set pool 2 pg_num to 64
[root@ceph1 ~ 16:38:43]# ceph osd pool get pool_web all
size: 2
min_size: 1
pg_num: 64
pgp_num: 32
crush_rule: replicated_rule
hashpspool: true
nodelete: false
nopgchange: false
nosizechange: false
write_fadvise_dontneed: false
noscrub: false
nodeep-scrub: false
use_gmt_hitset: 1
fast_read: 0
pg_autoscale_mode: on
bulk: false
[root@ceph1 ~ 16:38:52]# ceph mgr module enable pg_autoscaler
module 'pg_autoscaler' is already enabled (always-on)
[root@ceph1 ~ 16:39:15]# ceph osd pool set pool_web pg_autoscale_mode off
set pool 2 pg_autoscale_mode to off
[root@ceph1 ~ 16:39:27]# ceph osd pool autoscale-status
POOL                     SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  BULK
device_health_metrics      0                 3.0        119.9G  0.0000                                  1.0       1              on         False
pool_web                   0                 2.0        119.9G  0.0000                                  1.0      64              off        False
pool_era                   0                 2.0        119.9G  0.0000                                  1.0      32              on         False
[root@ceph1 ~ 16:39:32]# ceph osd pool set pool_web pg_autoscale_mode on
set pool 2 pg_autoscale_mode to on
[root@ceph1 ~ 16:39:42]# ceph osd pool autoscale-status
POOL                     SIZE  TARGET SIZE  RATE  RAW CAPACITY   RATIO  TARGET RATIO  EFFECTIVE RATIO  BIAS  PG_NUM  NEW PG_NUM  AUTOSCALE  BULK
device_health_metrics      0                 3.0        119.9G  0.0000                                  1.0       1              on         False
pool_web                   0                 2.0        119.9G  0.0000                                  1.0      64              on         False
pool_era                   0                 2.0        119.9G  0.0000                                  1.0      32              on         False
相关推荐
2301_773643623 天前
ceph分布式存储
分布式·ceph
m0_736034855 天前
ceph分布式存储
分布式·ceph
三十..6 天前
Ceph 三大存储接口深度实践与数据保护指南
运维·ceph
AOwhisky6 天前
Ceph系列第六期:Ceph 文件系统(CephFS)精讲
linux·运维·网络·笔记·ceph
潮起鲸落入海6 天前
Ceph 分布式存储 对象存储管理
ceph
qq_356408666 天前
Kubernetes Loki 日志收集系统部署文档 (读写分离模式 + Ceph S3 + Nginx 日志分离)
ceph·nginx·kubernetes
潮起鲸落入海6 天前
ceph分布式存储认证和授权,块存储管理
分布式·ceph
AOwhisky8 天前
Ceph系列第三期:Ceph 集群核心配置与管理
linux·运维·数据库·笔记·ceph