当前位置:   article > 正文

iscsi使用教程(下)

tgtd[3343309]: iser_ib_init(3431) failed to initialize rdma; load kernel mod

动态创建目标

安装iscsi服务端

# yum install -y scsi-target-utils.x86_64

修改配置文件

  1. # mkdir -p ~/volumes
  2. # sed -i '$ i include /root/volumes/*' /etc/tgt/tgtd.conf

启动服务

  1. ### 有告警是正常的,因为我们现在还没配置目标
  2. # tgtd -f --iscsi portal=92.0.0.14:3260
  3. tgtd: iser_ib_init(3436) Failed to initialize RDMA; load kernel modules?
  4. tgtd: work_timer_start(146) use timer_fd based scheduler
  5. tgtd: bs_init_signalfd(267) could not open backing-store module directory /usr/lib64/tgt/backing-store
  6. tgtd: bs_init(386) use signalfd notification

新增磁盘并创建LV

  1. # pvcreate /dev/sda
  2. # vgcreate cinder-volumes /dev/sda
  3. # lvcreate -n vol cinder-volumes -L 1g

创建目标配置文件

  1. # tee /root/volumes/vol.conf << EOF
  2. <target iqn.2010-10.org.openstack:vol>
  3. backing-store /dev/cinder-volumes/vol
  4. driver iscsi
  5. write-cache on
  6. </target>
  7. EOF

动态更新目标

# tgt-admin --update iqn.2010-10.org.openstack:vol

查询目标信息

  1. # tgtadm --lld iscsi --op show --mode target
  2. Target 1: iqn.2010-10.org.openstack:vol
  3. System information:
  4. Driver: iscsi
  5. State: ready
  6. I_T nexus information:
  7. LUN information:
  8. LUN: 0
  9. Type: controller
  10. SCSI ID: IET 00010000
  11. SCSI SN: beaf10
  12. Size: 0 MB, Block size: 1
  13. Online: Yes
  14. Removable media: No
  15. Prevent removal: No
  16. Readonly: No
  17. SWP: No
  18. Thin-provisioning: No
  19. Backing store type: null
  20. Backing store path: None
  21. Backing store flags:
  22. LUN: 1
  23. Type: disk
  24. SCSI ID: IET 00010001
  25. SCSI SN: beaf11
  26. Size: 1074 MB, Block size: 512
  27. Online: Yes
  28. Removable media: No
  29. Prevent removal: No
  30. Readonly: No
  31. SWP: No
  32. Thin-provisioning: No
  33. Backing store type: rdwr
  34. Backing store path: /dev/cinder-volumes/vol
  35. Backing store flags:
  36. ### 允许连接的客户端用户名
  37. Account information:
  38. ### 允许连接的客户端地址
  39. ACL information:
  40. ALL

安装客户端

# yum install iscsi-initiator-utils.x86_64 -y

发现目标

  1. # iscsiadm -m discovery -t sendtargets -p 92.0.0.14
  2. 92.0.0.14:3260,1 iqn.2010-10.org.openstack:vol

连接目标

  1. # iscsiadm -m node -T iqn.2010-10.org.openstack:vol -p 92.0.0.14 -l
  2. Logging in to [iface: default, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] (multiple)
  3. Login to [iface: default, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] successful.
  4. # iscsiadm -m session
  5. tcp: [1] 92.0.0.14:3260,1 iqn.2010-10.org.openstack:vol (non-flash)

断开连接

  1. # iscsiadm -m node -T iqn.2010-10.org.openstack:vol -p 92.0.0.14 -u
  2. Logging out of session [sid: 2, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260]
  3. Logout of [sid: 2, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] successful.
  4. # iscsiadm -m session
  5. iscsiadm: No active sessions.

转载于:https://www.cnblogs.com/silvermagic/p/9087165.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/217361
推荐阅读
相关标签
  

闽ICP备14008679号