ceph pgs: 3.030% pgs not active问题解决

1.问题描述:

在使用rook安装单节点ceph后,出现如下问题:

2.解决:

进行toolbox容器:

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash

将crush map导出:

$ ceph osd getcrushmap -o /etc/ceph/crushmap
6
将crush map反编译为可读模式:

$ crushtool -d /etc/ceph/crushmap -o /etc/ceph/crushmap.txt

修改curshmap,主要是修改OSD级别:

 将step chooseleaf firstn 0 type host 修改为:step chooseleaf firstn 0 type osd

[rook@rook-ceph-tools-5c6844fcd5-wm6js /]$ vi /etc/ceph/crushmap.txt 

# begin crush map
tunable choose_local_tries 0
tunable choose_local_fallback_tries 0
tunable choose_total_tries 50
tunable chooseleaf_descend_once 1
tunable chooseleaf_vary_r 1
tunable chooseleaf_stable 1
tunable straw_calc_version 1
tunable allowed_bucket_algs 54

# devices
device 0 osd.0 class hdd
device 1 osd.1 class hdd
device 2 osd.2 class hdd
device 3 osd.3 class hdd

# types
type 0 osd
type 1 host
type 2 chassis
type 3 rack
type 4 row
type 5 pdu
type 6 pod
type 7 room
type 8 datacenter
type 9 zone
type 10 region
type 11 root

# buckets
host worker01 {
        id -3           # do not change unnecessarily
        id -4 class hdd         # do not change unnecessarily
        # weight 4.362
        alg straw2
        hash 0  # rjenkins1
        item osd.1 weight 1.090
        item osd.2 weight 1.090
        item osd.3 weight 1.090
        item osd.0 weight 1.090
}
root default {
        id -1           # do not change unnecessarily
        id -2 class hdd         # do not change unnecessarily
        # weight 4.362
        alg straw2
        hash 0  # rjenkins1
        item worker01 weight 4.362
}

# rules
rule replicated_rule {
        id 0
        type replicated
        min_size 1
        max_size 10
        step take default
        #将step chooseleaf firstn 0 type host 修改为:step chooseleaf firstn 0 type osd
        step chooseleaf firstn 0 type osd
        step emit
}
rule replicapool {
        id 1
        type replicated
        min_size 1
        max_size 10
        step take default
        step choose firstn 0 type osd
        step emit
}

# end crush map

[rook@rook-ceph-tools-5c6844fcd5-wm6js ~]$ crushtool -c /etc/ceph/crushmap.txt -o /etc/ceph/crushmap-new
[rook@rook-ceph-tools-5c6844fcd5-wm6js ~]$ ceph osd setcrushmap -i /etc/ceph/crushmap-new
7

验证:

[rook@rook-ceph-tools-5c6844fcd5-wm6js ~]$ ceph -s 
  cluster:
    id:     7d358d90-4176-4a8b-9c8c-f9d979df77a3
    health: HEALTH_WARN
            1 pool(s) have no replicas configured
 
  services:
    mon: 1 daemons, quorum a (age 29m)
    mgr: a(active, since 28m)
    osd: 4 osds: 4 up (since 12m), 4 in (since 28m)
 
  data:
    pools:   2 pools, 33 pgs
    objects: 6 objects, 35 B
    usage:   21 MiB used, 4.4 TiB / 4.4 TiB avail
    pgs:     33 active+clean
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值