ceph rbd 通过iscsi tgt共享 查看和命令手动操作

1. rbd查看操作

查看ceph存储池
ceph osd pool ls
查看rbd
# rbd -p poolcopyhost1 ls
    luncopyhost1

查看ceph存储池副本和故障域规则
# ceph osd dump |grep poolcopyhost1
        pool 14 'poolcopyhost1' replicated size 2 min_size 1 crush_ruleset 1  # 2副本 crush_ruleset 1 故障域规则

查看故障域规则crush_ruleset 1 绑定OSD个数
导出crush map
# ceph osd getcrushmap -o crushmap.dump     # crushmap.dump 加密
# crushtool -d crushmap.dump -o crushmap.txt        # 转换为明文crushmap.txt
cat crushmap.txt 查看ruleset 1
    # rules
        rule rulecopyhost1 {                  #  rulecopyhost1 故障域规则名称 
            ruleset 1
            type replicated
            min_size 1
            max_size 10
            step take root_rulecopyhost1      # # ceph osd tree 查看root_rulecopyhost1
            step chooseleaf firstn 0 type host
            step emit
        }


查看ruleset 1 对应rulecopyhost1 有几个OSD
# ceph osd tree
root root_rulecopyhost1 
osd.0
osd.1  

2. target iscsi 查看

查看iscsi 是否支持rbd
# tgtadm --lld iscsi --mode system --op show |grep rbd
    rbd (bsoflags sync:direct)

3. 查看tgt配置文件

4. 查看已创建的scsi target

# tgtadm --lld iscsi --mode target --op show
    Target 1: targetcopyhost1                    #target iscsi 名称targetcopyhost1
        LUN information:
            LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 1074 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: rbd
            Backing store path: poolcopyhost1/luncopyhost1   # target绑定 存储池/rbd名称
            Backing store flags:

参考:
1.通过iscsi协议使用ceph rbd

你可能感兴趣的:(Ceph)