注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

红烧鱼

linux & windows management

 
 
 

日志

 
 
关于我
mac

专注IT基础架构设计与运维。 欢迎给我留言,或邮件沟通zjwsk@163.com

网易考拉推荐

iSCSI target [LIO kernel] config  

2016-11-01 11:01:26|  分类: Linux |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
 
A storage on a network is called iSCSI Target, a Client which connects to iSCSI Target is called iSCSI Initiator.


  • Configure iSCSI Target


1.    Install administration tools first.
    # yum -y install targetcli

2.     Configure iSCSI Target.
    For example, create an disk-image under the /iscsi_disks directory and set it as a SCSI device.
    # mkdir /iscsi_disks

2.1  enter the admin console
    # targetcli

2.2 create a disk-image with the name "disk01" on /iscsi_disks/disk01.img with 10G
/> cd backstores/fileio
/backstores/fileio> create disk01 /iscsi_disks/disk01.img 500M

2.3 create a target
/backstores/fileio> cd /iscsi
/iscsi> create iqn.2016-11.world.srv:storage.target00

2.4 set ACL (it's the IQN of an initiator you permit to connect)
/iscsi> cd /iscsi/iqn.2016-11.world.srv:storage.target00/tpg1/acls
/iscsi/iqn.20...t00/tpg1/acls> create iqn.2016-11.world.srv:www.srv.world

2.6 set UserID for authentication
/iscsi/iqn.20...t00/tpg1/acls> cd iqn.2016-11.world.srv:www.srv.world
/iscsi/iqn.20....srv.world> set auth userid=username
/iscsi/iqn.20....srv.world> set auth password=password


2.7 set LUN
/iscsi> cd /iscsi/iqn.2016-11.world.srv:storage.target00/tpg1/luns
/iscsi/iqn.20...t00/tpg1/luns> create /backstores/fileio/disk01


2.8 save and exie
/iscsi/iqn.20...t00/tpg1/luns> saveconfig
/iscsi/iqn.20...t00/tpg1/luns> exit

2.9 By default authentication is enabled, disable it.
/> cd /iscsi/iqn.2016-02.local.itzgeek.server:disk1/tpg1/
/iscsi/iqn.20...er:disk1/tpg1> set attribute authentication=0
/iscsi/iqn.20...er:disk1/tpg1> set attribute generate_node_acls=1



2.10 enable and start LIO iscsi target
#systemctl enable target.service
#systemctl start target.service
#firewall-cmd --add-service=iscsi-target --permanent



  • Configure iSCSI Initiator with CHAP authentication:

1. install iscsi client package
    # yum install iscsi-initiator-utils -y

2. Add iscsi initiator name at /etc/iscsi/initiatorname.iscsi
    InitiatorName=iqn.2016-02.local.itzgeek.server:node1node2

3. Discover the target
    # iscsiadm -m discovery -t st -p 192.168.12.20
    
4. Enable CHAP authentication in iscsid.conf file, uncomment and modify the green colored lines as per your environment.
    # /etc/iscsi/iscsid.conf
    # To enable CHAP authentication set node.session.auth.authmethod to CHAP. The default is None.
    node.session.auth.authmethod = CHAP

    # To set a CHAP username and password for initiator authentication by the target(s), uncomment the following lines:
    node.session.auth.username = user
    node.session.auth.password = password

5. Restart and enable the initiator service.
 systemctl restart iscsid.service && systemctl enable iscsid.service

6. Login to the discovered target.
 iscsiadm -m node -T iqn.2016-02.local.itzgeek.server:disk1 -p 192.168.12.20 -l
 
    --http://www.itzgeek.com/how-tos/linux/centos-how-tos/configure-iscsi-target-initiator-on-centos-7-rhel7.html


  评论这张
 
阅读(12)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017