1.服务端建立ISCSI存储 在RHEL5上安装scsi-target-utils.i386包 启动tgtd服务 service tgtd start 设置开机自动启动 chkconfig tgtd on 创建一个target服务 tgtadm --lld iscsi --op new
--mode target --tid=1 --targetname iqn.2009-12-10.com.example 创建一个lun tgtadm --lld iscsi --op new
--mode=logicalunit --tid=1 --lun=1 -b /dev/sda5 添加信任ip tgtadm --lld iscsi --op
bind --mode=target --tid=1 -I ALL 将上面上条命令写到/etc/rc.local里面 查看设备 tgtadm --lld iscsi --op show --mode target
[root@ovmm ovm-manager-3]# tgtadm --lld iscsi --op show --mode target Target 1: iqn.2009-12-10.com.example System information: Driver: iscsi State: ready I_T nexus information: I_T nexus: 4 Initiator: iqn.1988-12.com.oracle:4d561174960 Connection: 0 IP Address: 172.16.1.11 I_T nexus: 6 Initiator: iqn.1988-12.com.oracle:d77fc5f190a0 Connection: 0 IP Address: 172.16.1.12 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 Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 21479 MB, Block size: 512 Online: Yes Removable media: No Prevent removal: No Readonly: No Backing store type: rdwr Backing store path: /dev/sda5 Backing store flags:
2.客户端连接iscsi存储 在ISCSI客户机安装iscsi-initiator-utils.i386包 启动iscsi服务 service iscsi start 设置开机自动启动 chkconfig iscsi on 发现服务端设备 iscsiadm --mode discoverydb --type sendtargets --portal ip:3260 --discover 登入存储 iscsiadm --mode node --targetname iqn. --portal ip:3260 --login
[此贴子已经被作者于2013-6-13 15:58:01编辑过] |