一、存储设备类型
二、配置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,可以直接修改配置文件
2015职称计算机考试书PowerPoint2007中 .. 定价:¥45 优惠价:¥42 更多书籍 | |
2015年全国职称计算机考试教材(2007模 .. 定价:¥225 优惠价:¥213 更多书籍 |