Ceph mimic 操作手册记录

##查看ceph 使用量
[root@ceph02 ~]# ceph df
GLOBAL:
    SIZE        AVAIL       RAW USED     %RAW USED 
    400 GiB     392 GiB      8.1 GiB          2.01 
POOLS:
    NAME        ID     USED        %USED     MAX AVAIL     OBJECTS 
    images      1      4.6 MiB         0       186 GiB          14 
    images2     2         73 B         0       186 GiB           5 
###查看pool 个数创建pool
[root@ceph02 ~]# ceph osd pool ls
images
images2
[root@ceph02 ~]# ceph osd pool create images3 32
pool 'images3' created
##查看 pool 的副本数和pg数
[root@ceph02 ~]# ceph osd pool get images size
size: 2
[root@ceph02 ~]# ceph osd pool get images pg_num
pg_num: 32

###查看 pool 中的块设备
[root@ceph02 ~]# rbd ls images
test_disk
test_disk1
test_disk2
[root@ceph02 ~]#
##创建块设备
[root@ceph02 ~]# rbd create --size 50 images3/test_disk1
[root@ceph02 ~]# rbd info images3/test_disk1
rbd image 'test_disk1':
        size 50 MiB in 13 objects
        order 22 (4 MiB objects)
        id: 13216b8b4567
        block_name_prefix: rbd_data.13216b8b4567
        format: 2
        features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
        op_features: 
        flags: 
        create_timestamp: Fri Sep 27 10:59:26 2019
[root@ceph02 ~]# 

###修改块设备属性 
rbd feature disable images3/test_disk1 exclusive-lock object-map fast-diff deep-flatten

###ceph client 查看 
[root@ceph01 ~]# rbd --image images/test_disk info
rbd image 'test_disk':
        size 50 MiB in 13 objects
        order 22 (4 MiB objects)
        id: 11b56b8b4567
        block_name_prefix: rbd_data.11b56b8b4567
        format: 2
        features: layering
        op_features: 
        flags: 
        create_timestamp: Thu Sep 26 15:57:08 2019

### 客户端映射块设备


rbd map images/test_disk
/dev/rbd1
###fdisk -l 
Disk /dev/rbd1: 52 MB, 52428800 bytes, 102400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 4194304 bytes / 4194304 bytes

##格式化和mount
mkfs.ext4 /dev/rbd1
mount /dev/rbd1 /opt

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

石兴稳

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值