美文网首页
tgtd + librbd在线扩容

tgtd + librbd在线扩容

作者: ypdai | 来源:发表于2019-09-29 18:25 被阅读0次

title: tgtd + librbd在线扩容

前言

这里介绍下iscsi(tgt模式)使用ceph的librbd时,如何在线对rbd进行扩容操作。

这里假设你已经配置好了ceph集群。我这里的测试环境如下:

ceph05(192.168.10.30)配置单节点ceph集群,同时也作为配置tgtd服务节点。

ceph06(192.168.10.31)作为tgtd服务的客户端(initiator)节点。

1、服务端(tgtd)配置

准备一个rbd:

[root@ceph05 ~]# rbd ls
img01 
[root@ceph05 ~]# rbd info img01
rbd image 'img01':
    size 22GiB in 5632 objects
    order 22 (4MiB objects)
    block_name_prefix: rbd_data.10206b8b4567
    format: 2
    features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
    flags: 
    create_timestamp: Fri Sep 27 11:25:04 2019

配置、启动tgtd服务:

[root@ceph05 ~]# cat /etc/tgt/conf.d/my.conf 
<target iqn.2019-09.com.example:target01>
    <backing-store rbd/img01>   
        lun 1
        vendor_id iqn.2019-09.com.example
    </backing-store>

    bs-type rbd
</target>
[root@ceph05 ~]# 
[root@ceph05 ~]# systemctl start tgtd

查看tgtd信息:

[root@ceph05 ~]# tgt-admin --show
Target 1: iqn.2019-09.com.example:target01
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 4
            Initiator: iqn.1994-05.com.redhat:bf8e54aec2e alias: ceph06
            Connection: 0
                IP Address: 192.168.10.31
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            SWP: No
            Thin-provisioning: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 23622 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: rbd/img01
            Backing store flags: 
    Account information:
    ACL information:
        ALL

2、客户端(initiator)配置

在客户端发现、登陆这个target:

[root@ceph06 ~]# iscsiadm -m discovery -t st -p 192.168.10.30
[root@ceph06 ~]# iscsiadm -m node -T iqn.2019-09.com.example:target01 -p 192.168.10.30 -l

查看设备:

[root@ceph06 ~]# lsblk
...
sde               8:64   0   22G  0 disk 

sde就是iscsi设备。

3、扩容rbd

然后在服务端(tgtd)对rbd进行扩容:

[root@ceph05 ~]# rbd resize img01 --size 25G
Resizing image: 100% complete...done.
[root@ceph05 ~]# rbd info img01
rbd image 'img01':
    size 25GiB in 6400 objects
    order 22 (4MiB objects)
    block_name_prefix: rbd_data.10206b8b4567
    format: 2
    features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
    flags: 
    create_timestamp: Fri Sep 27 11:25:04 2019

更新tgtd配置(服务端执行):

[root@ceph05 ~]# tgt-admin --update iqn.2019-09.com.example:target01

然后重新扫描下scsi设备(客户端执行):

# 查看对应磁盘的SCSI控制器设备信息
[root@ceph06 ~]# lsscsi
...
[10:0:0:0]   storage IET      Controller       0001  -        
[10:0:0:1]   disk    iqn.2019 VIRTUAL-DISK     0001  /dev/sde

# 重新扫描SCSI总线,其中的10:0:0:1就是上面lsscsi命令查到的/dev/sde设备对应的磁盘的SCSI控制器设备信息
[root@ceph06 ~]# echo "---" > /sys/class/scsi_device/10\:0\:0\:1/device/rescan

最后查看设备容量已经更新到25G:

[root@ceph06 ~]# lsblk
...
sde               8:64   0   25G  0 disk 

相关文章

  • tgtd + librbd在线扩容

    title: tgtd + librbd在线扩容 前言 这里介绍下iscsi(tgt模式)使用ceph的librb...

  • linux centos7 cpu使用不均匀,虚拟化在线扩容

    虚拟化在线扩容 虚拟化是已经可以实现在线扩容的了,在线调整cpu,内存,硬盘,网络. 但是并不是说就是完全在线的....

  • 在线扩容

    由于在前期设计中,对业务支持而言的角度,认为当前某些数据为可归档数据,当业务发展过程中,出现了变动,目前需对某些数...

  • 存储管理Ⅱ-swap、逻辑卷

    一.存储管理Ⅱ 1.逻辑卷LVM 1.1.LVM管理 在线扩容 online 创建LVM VG的扩容 LVM的扩容...

  • Ceph Luminous librbd & libra

    1. librbd & librados介绍 Librbd模块实现了RBD接口,其基于Librados实现了对RB...

  • zookeeper 在线热迁移

    zookeeper 在线扩容 目标:扩容过程中,zookeeper 集群对外提供服务正常 当前集群状态 集群...

  • 阿里云ECS磁盘在线扩容

    阿里ECS磁盘在线扩容阿里后台选择在线扩容,支付完成之后 使用df -h并没有发现我们的磁盘空间增加 使用fdis...

  • lvm 在线扩容

    1.先查看逻辑卷组空间是否足够 [root@test server]# vgdisplay --- Volume...

  • iscsi(tgt)+librbd使用

    title: iscsi(tgt)+librbd使用 1、前言 因为要调试看下librbd的一个功能。然后准备在自...

  • Linux lvm在线扩容

    1、查看磁盘空间 2、创建物理卷 3、查看物理卷 4、查看当前卷组 5、扩展卷组,将/dev/sdb物理卷加到VG...

网友评论

      本文标题:tgtd + librbd在线扩容

      本文链接:https://www.haomeiwen.com/subject/bhkqpctx.html