zoukankan      html  css  js  c++  java
  • 创建,查看,删除pool,查看,修改pool参数命令总结

    标签(空格分隔): ceph,ceph运维,pool


    1. 创建pool命令:

    ceph的pool有两种类型,一种是副本池,一种是ec池,创建时也有所区别

    1.1 创建副本池:

    $ sudo ceph osd pool create pool-name pg_num pgp_num
    

    如:

    [root@node3 ~]# ceph osd pool create testpool 128 128 
    pool 'testpool' created
    

    1.2 创建ec池:

    $ sudo ceph osd pool create pool-name pg_num pgp_num erasure
    

    如:

    [root@node3 ~]# ceph osd pool create ecpool 12 12 erasure
    pool 'ecpool' created
    

    2. 查看pool命令

    查看pool命令:

    [root@node3 ~]# ceph osd lspools
    2 testpool,4 ecpool,
    

    [root@node3 ~]# rados lspools
    testpool
    ecpool
    

    两个命令的区别就是第一个可以查看pool的id

    查看pool的详细配置信息:

    [root@node3 ~]# ceph osd pool ls detail
    pool 2 'testpool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 46 flags hashpspool stripe_width 0
    pool 4 'ecpool' erasure size 3 min_size 3 crush_rule 1 object_hash rjenkins pg_num 12 pgp_num 12 last_change 55 flags hashpspool stripe_width 8192
    

    [root@node3 ~]# ceph osd dump|grep pool
    pool 2 'testpool' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 128 pgp_num 128 last_change 46 flags hashpspool stripe_width 0
    pool 4 'ecpool' erasure size 3 min_size 3 crush_rule 1 object_hash rjenkins pg_num 12 pgp_num 12 last_change 55 flags hashpspool stripe_width 8192
    

    可以看出两个命令输出内容是一样的

    查看pool的用量信息:

    [root@node3 ~]# rados df
    POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR 
    ecpool       0       0      0      0                  0       0        0      0  0      0  0 
    testpool     0       0      0      0                  0       0        0      0  0      0  0 
    
    total_objects    0
    total_used       6386M
    total_avail      55053M
    total_space      61440M
    

    3. 删除pool命令

    $ sudo ceph osd pool delete {pool-name} {pool-name} --yes-i-really-really-mean-it
    

    如:

    [root@node3 ~]# ceph osd pool delete ecpool ecpool  --yes-i-really-really-mean-it
    pool 'ecpool' removed
    

    如果删除pool时提示error请参考: 删除pool error的解决方法

    4. 获取pool参数:

    $ sudo ceph osd pool get {pool-name} {key}
    
    

    如获取副本池的副本数:

    [root@node3 ~]# ceph osd pool get testpool size
    size: 3
    

    5. 设置pool参数:

    $ sudo ceph osd pool set  {pool-name} {key} {value}
    
    

    如设置副本池的副本数:

    [root@node3 ~]# ceph osd pool set testpool size 2
    set pool 2 size to 2
    
  • 相关阅读:
    SQL错误码
    用collectionview实现瀑布流-转
    iOS开发~CocoaPods使用详细说明
    传值
    iOS 传值方式
    iOS Cocos2d-x 开发环境的搭建
    iOS 高效率编程工具篇
    iOS地图定位系统语言为英文时,返回中文位置信息
    Xcode脚本自动化打包问题:xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH
    Cannot create __weak reference in file xxxxxxxxx
  • 原文地址:https://www.cnblogs.com/sisimi/p/7753388.html
Copyright © 2011-2022 走看看