RHEL5 iscsi target 설정방법

– 로지컬 볼륨 생성

# lvscan
  ACTIVE            ‘/dev/Vol_iscsi/Log_iscsi0’ [40.00 GB] inherit
  ACTIVE            ‘/dev/Vol_iscsi/Log_iscsi1’ [40.00 GB] inherit
  ACTIVE            ‘/dev/Vol_iscsi/Log_iscsi2’ [40.00 GB] inherit
  
현재 시스템에서 iscsi를 통해서 client에게 보여줄 block device가 3개 있다.

# yum -y install scsi-target-utils

# service tgtd start

# tgtadm –lld iscsi –op new –mode target –tid 1 -T iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1
# tgtadm –lld iscsi –op show –mode target
Target 1: iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0
            Backing store: No backing store
    Account information:
    ACL information:

# tgtadm –lld iscsi –op new –mode logicalunit –tid=1 –lun=1 -b /dev/Vol_iscsi/Log_iscsi0
# tgtadm –lld iscsi –op new –mode logicalunit –tid=1 –lun=2 -b /dev/Vol_iscsi/Log_iscsi1
# tgtadm –lld iscsi –op new –mode logicalunit –tid=1 –lun=3 -b /dev/Vol_iscsi/Log_iscsi2

– 아래 하나만 선택

# tgtadm –lld iscsi –op bind –mode target –tid 1 -I ALL (모두)
or
# tgtadm –lld iscsi –op bind –mode target –tid 1 -I 192.168.0.0/27 (특정대역)
or
# tgtadm –lld iscsi –op bind –mode target –tid 1 -I 210.220.241.101 (특정호스트)
# tgtadm –lld iscsi –op bind –mode target –tid 1 -I 210.220.241.102

# tgtadm –lld iscsi –op show –mode target
Target 1: iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0
            Backing store: No backing store
        LUN: 1
            Type: disk
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 40G
            Backing store: /dev/Vol_iscsi/Log_iscsi0
        LUN: 2
            Type: disk
            SCSI ID: deadbeaf1:2
            SCSI SN: beaf12
            Size: 40G
            Backing store: /dev/Vol_iscsi/Log_iscsi1
            L
    Account information:
    ACL information:
        ALL

# tgtadm –lld iscsi –op show –mode target –tid 1

MaxRecvDataSegmentLength=8192
MaxXmitDataSegmentLength=8192
HeaderDigest=None
DataDigest=None
InitialR2T=Yes
MaxOutstandingR2T=1
ImmediateData=Yes
FirstBurstLength=65536
MaxBurstLength=262144
DataPDUInOrder=Yes
DataSequenceInOrder=Yes
ErrorRecoveryLevel=0
IFMarker=No
OFMarker=No
DefaultTime2Wait=2
DefaultTime2Retain=20
OFMarkInt=Reject
IFMarkInt=Reject
MaxConnections=1

– Initiator에서 테스트 해보기 (클라이언트)

# cat /proc/partitions
major minor  #blocks  name

   8     0  244140625 sda
   8     1     104391 sda1
   8     2    4008217 sda2
   8     3    4008217 sda3
   8     4          1 sda4

# yum -y install iscsi-initiator-utils

# service iscsi status
iscsid (pid 1830 1829) is running…

# iscsiadm -m discovery -t st -p 10.0.0.62
10.0.0.62:3260,1 iqn.2008-06.com.oracle.kr.sd-iscsi:storage.disk1

# iscsiadm -m node –loginall all
Login session [10.0.0.62:3260 iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1]

# cat /proc/partitions
major minor  #blocks  name

   8     0  244140625 sda
   8     1     104391 sda1
   8     2    4008217 sda2
   8     3    4008217 sda3
   8     4          1 sda4
   8    16   41943040 sdb
   8    32   41943040 sdc
   8    48   41943040 sdd
  

# iscsiadm -m node
10.0.0.62:3260,1 iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1

# iscsiadm -m node –targetname iqn.2008-06.com.futurebnc.www.sd-iscsi:storage.disk1 –portal 10.0.0.62:3260 –logout

# cat /proc/partitions

– 리부팅 후에는 설정이 사리진다…

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

페이스북/트위트/구글 계정으로 댓글 가능합니다.