考试首页 | 考试用书 | 培训课程 | 模拟考场 | 考试论坛  
  当前位置:Linux认证 > 红帽认证 > 红帽认证辅导 > 文章内容
  

RHCE7认证学习笔记:配置ISCSI

来源:Linux社区 [ 2016年2月5日 ] 【

一、存储设备类型

  • DSA:直接区域存储
  • NAS:网络区域存储
  • SAN:存储区域网络,块级别共享

二、配置iscsi服务器端

这里举例子说明,假如服务器有2个分区/dev/sdb7,/dev/sdb8要共享出去:   
    /dev/sdb7      1230848      1640447    200M  Linux filesyste
    /dev/sdb8      1640448      2459647    400M  Linux filesyste

安装target包:
[root@linuxidc ~]# yum install target\* -y

启动target服务
[root@linuxidc ~]# systemctl start target
   
配置步骤:

1、准备要共享的块;

使用targetcli命令进入target配置界面:
 [root@linuxidc ~]# targetcli

/> pwd
/
/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 0]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 0]
  o- loopback ......................................................................................................... [Targets: 0]

进入backstores/block目录创建要共享的块,创建block1和block2:
       
/> cd backstores/
/backstores> ls
o- backstores ................................................................................................................ [...]
  o- block .................................................................................................... [Storage Objects: 0]
  o- fileio ................................................................................................... [Storage Objects: 0]
  o- pscsi .................................................................................................... [Storage Objects: 0]
  o- ramdisk .................................................................................................. [Storage Objects: 0]
       
/backstores/block> create block1 dev=/dev/sdb7
Created block storage object block1 using /dev/sdb7.
/backstores/block> create block2 dev=/dev/sdb8
Created block storage object block2 using /dev/sdb8.

/backstores/block> ls
o- block ...................................................................................................... [Storage Objects: 2]
  o- block1 .......................................................................... [/dev/sdb7 (200.0MiB) write-thru deactivated]
  o- block2 .......................................................................... [/dev/sdb8 (400.0MiB) write-thru deactivated]

exit退出保存targetcli,并重新进入:
/backstores/block> exit
Global pref auto_save_on_exit=true
Last 10 configs saved in /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
[root@linuxidc ~]# targetcli

2、创建一个target;

target标准名字格式:

年  月  域名倒写 名字

iqn.2015-02.com.sg:disk1

进入iscsi目录,创建target:

/iscsi> create iqn.2015-02.com.sg:disk1
                   
/iscsi> ls
o- iscsi .............................................................................................................. [Targets: 1]
  o- iqn.2015-02.com.sg:disk1 ............................................................................................ [TPGs: 1]

3、在target上面创建一个lun;

进入/iscsi/iqn.2015-02.com.sg:disk1/tpg1目录:     
 /iscsi/iqn.20...sg:disk1/tpg1> ls
o- tpg1 ..................................................................................................... [no-gen-acls, no-auth]
  o- acls ................................................................................................................ [ACLs: 0]
  o- luns ................................................................................................................ [LUNs: 0]
  o- portals .......................................................................................................... [Portals: 0]

acls目录创建共享密码:                   
 /iscsi/iqn.20...sg:disk1/tpg1> acls/ create iqn.2015-02.com.sg:diskpasswd

创建lun:       
/iscsi/iqn.20...sg:disk1/tpg1> luns/ create /backstores/block/block1
Created LUN 0.
Created LUN 0->0 mapping in node ACL iqn.2015-02.com.sg:diskpasswd
/iscsi/iqn.20...sg:disk1/tpg1> luns/ create /backstores/block/block2
Created LUN 1.
Created LUN 1->1 mapping in node ACL iqn.2015-02.com.sg:diskpasswd

 o- luns .......................................................................................................... [LUNs: 2]
  |    | o- lun0 ....................................................................................... [block/block1 (/dev/sdb7)]
  |    | o- lun1 ....................................................................................... [block/block2 (/dev/sdb8)]

portal创建共享端口和地址:
/iscsi/iqn.20...sg:disk1/tpg1> portals/ create 10.35.89.32
Using default IP port 3260
Created network portal 10.35.89.32:3260.

exit退出并保存:

Configuration saved to /etc/target/saveconfig.json

配置文件保存在:/etc/target/saveconfig.json,可以直接修改配置文件

首页 1 2 尾页
本文纠错】【告诉好友】【打印此文】【返回顶部
将考试网添加到收藏夹 | 每次上网自动访问考试网 | 复制本页地址,传给QQ/MSN上的好友 | 申请链接 | 意见留言 TOP
关于本站  网站声明  广告服务  联系方式  站内导航  考试论坛
Copyright © 2007-2013 中华考试网(Examw.com) All Rights Reserved