차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
iscsi [2023/03/23 02:15] – koov | iscsi [2024/06/11 02:18] (현재) – koov | ||
---|---|---|---|
줄 3: | 줄 3: | ||
* [[iSCSI_Target]] | * [[iSCSI_Target]] | ||
* [[RHEL7 iSCSI 구성하기]] | * [[RHEL7 iSCSI 구성하기]] | ||
- | + | | |
- | ===== iSCSI Target_RHEL 6 ===== | + | * [[RHEL7 이상 |
- | 참조링크 : https:// | + | |
- | + | ||
- | 테스트환경 | + | |
- | * HOST OS : CentOS 6.6 64bit | + | |
- | * GUEST OS : CentOS 6.6 64bit | + | |
- | ==== tgt-setup-lun | + | |
- | ---- | + | |
- | + | ||
- | **tgt-setup-lun** : target 을 생성하고 target 을 장치에 추가해 주는 Script 명령어 입니다. \\ | + | |
- | 해당 명령어로 실행시 간단하게 iSCSI Target 을 생성 관리 할수 있습니다. \\ | + | |
- | + | ||
- | === Step.1 iSCSI Target 설치 === | + | |
- | <code vim> | + | |
- | [root@iscsi ~]# yum install scsi-target-utils.x86_64 -y | + | |
- | </ | + | |
- | <code vim> | + | |
- | [root@iscsi ~]# rpm -qa | grep scsi-target-utils | + | |
- | scsi-target-utils-1.0.24-16.el6.x86_64 | + | |
- | </ | + | |
- | === Step.2 iSCSI Target | + | |
- | + | ||
- | <code vim> | + | |
- | [root@iscsi ~]# service tgtd start | + | |
- | [root@iscsi ~]# service tgtd status | + | |
- | [root@iscsi ~]# chkconfig tgtd on | + | |
- | </ | + | |
- | === Step.3 | + | |
- | + | ||
- | * 디스크 생성 및 LVM 구성은 이곳에서 따로 보여주지 않는다. | + | |
- | * tgt-setup-lun 스크립트 명령어로 아래와 같이 생성해 준다. | + | |
- | <code vim> | + | |
- | [root@iscsi ~]# tgt-setup-lun -d / | + | |
- | [root@iscsi ~]# tgt-setup-lun -d / | + | |
- | [root@iscsi ~]# tgt-setup-lun -d / | + | |
- | [root@iscsi ~]# tgt-setup-lun -d / | + | |
- | </ | + | |
- | + | ||
- | * 생성된 파일을 targets.conf 파일에 입력하기 | + | |
- | <code vim> | + | |
- | [root@iscsi ~]# | + | |
- | [root@iscsi ~]#vim target.conf | + | |
- | <target iqn.2001-04.com.iscsi-iSCSI_Target3> | + | |
- | backing-store / | + | |
- | </ | + | |
- | + | ||
- | <target iqn.2001-04.com.iscsi-iSCSI_Target1> | + | |
- | backing-store / | + | |
- | </ | + | |
- | + | ||
- | <target iqn.2001-04.com.iscsi-iSCSI_Target4> | + | |
- | backing-store / | + | |
- | </ | + | |
- | + | ||
- | <target iqn.2001-04.com.iscsi-iSCSI_Target2> | + | |
- | backing-store / | + | |
- | </ | + | |
- | + | ||
- | [root@iscsi ~]# | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | * tgtd 데몬 재 시작 | + | |
- | <code vim> | + | |
- | + | ||
- | [root@iscsi ~]# service tgtd restart | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | * Target 확인 | + | |
- | <code vim> | + | |
- | + | ||
- | [root@iscsi ~]# tgt-admin -s | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | <code vim> | + | |
- | Target 1: iqn.2015-04.com.iscsi-iSCSI_Target1 | + | |
- | System information: | + | |
- | Driver: iscsi | + | |
- | State: ready | + | |
- | I_T nexus information: | + | |
- | LUN information: | + | |
- | LUN: 0 | + | |
- | Type: controller | + | |
- | SCSI ID: IET | + | |
- | 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 | + | |
- | SCSI SN: beaf11 | + | |
- | Size: 32216 MB, Block size: 512 | + | |
- | Online: Yes | + | |
- | Removable media: No | + | |
- | Prevent removal: No | + | |
- | Readonly: No | + | |
- | Backing store type: rdwr | + | |
- | Backing store path: / | + | |
- | Backing store flags: | + | |
- | Account information: | + | |
- | ACL information: | + | |
- | ALL | + | |
- | Target 2: iqn.2015-04.com.iscsi-iSCSI_Target2 | + | |
- | System information: | + | |
- | Driver: iscsi | + | |
- | State: ready | + | |
- | I_T nexus information: | + | |
- | LUN information: | + | |
- | LUN: 0 | + | |
- | Type: controller | + | |
- | SCSI ID: IET | + | |
- | SCSI SN: beaf20 | + | |
- | 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 | + | |
- | SCSI SN: beaf21 | + | |
- | Size: 10737 MB, Block size: 512 | + | |
- | Online: Yes | + | |
- | Removable media: No | + | |
- | Prevent removal: No | + | |
- | Readonly: No | + | |
- | Backing store type: rdwr | + | |
- | Backing store path: / | + | |
- | Backing store flags: | + | |
- | Account information: | + | |
- | ACL information: | + | |
- | ALL | + | |
- | Target 3: iqn.2015-04.com.iscsi-iSCSI_Target3 | + | |
- | System information: | + | |
- | Driver: iscsi | + | |
- | State: ready | + | |
- | I_T nexus information: | + | |
- | LUN information: | + | |
- | LUN: 0 | + | |
- | Type: controller | + | |
- | SCSI ID: IET | + | |
- | SCSI SN: beaf30 | + | |
- | 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 | + | |
- | SCSI SN: beaf31 | + | |
- | Size: 5377 MB, Block size: 512 | + | |
- | Online: Yes | + | |
- | Removable media: No | + | |
- | Prevent removal: No | + | |
- | Readonly: No | + | |
- | Backing store type: rdwr | + | |
- | Backing store path: / | + | |
- | Backing store flags: | + | |
- | Account information: | + | |
- | ACL information: | + | |
- | ALL | + | |
- | Target 4: iqn.2015-04.com.iscsi-iSCSI_Target4 | + | |
- | System information: | + | |
- | Driver: iscsi | + | |
- | State: ready | + | |
- | I_T nexus information: | + | |
- | LUN information: | + | |
- | LUN: 0 | + | |
- | Type: controller | + | |
- | SCSI ID: IET | + | |
- | SCSI SN: beaf40 | + | |
- | 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 | + | |
- | SCSI SN: beaf41 | + | |
- | Size: 5344 MB, Block size: 512 | + | |
- | Online: Yes | + | |
- | Removable media: No | + | |
- | Prevent removal: No | + | |
- | Readonly: No | + | |
- | Backing store type: rdwr | + | |
- | Backing store path: / | + | |
- | Backing store flags: | + | |
- | Account information: | + | |
- | ACL information: | + | |
- | ALL | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | * target 제거 | + | |
- | <code vim> | + | |
- | + | ||
- | tgt-admin --delete ALL // 모든 타겟을 지운다. | + | |
- | tgt-admin --delete tid=4 // 타겟4번을 지운다. | + | |
- | tgt-admin --delete iqn.2015-04.com | + | |
- | + | ||
- | + | ||
- | </ | + | |
- | + | ||
- | ===== iSCSI Target_RHEL 7 ===== | + | |
- | 테스트환경 | + | |
- | * HOST OS : CentOS Linux release 7 | + | |
- | * GUEST OS : CentOS Linux release 7 | + | |
- | + | ||
- | ==== targetcli ==== | + | |
- | + | ||
- | targetcli 는 트리 기반의 파일 시스템과 유사한 방식으로 탐색한다 | + | |
- | targetcli 는 커널의 대상 서스 시스템을 구성하고 저장하기 위한 쉘 스크립트 이다 | + | |
- | + | ||
- | === Step1. Install and run targetcli === | + | |
- | 이 문서에서는 공유 디스크로 생성한 LVM 볼륨 | + | |
- | 현재 등록되어 있는 디스크 정보들을 확인한다 | + | |
- | <code vim> | + | |
- | [root@server1 ~]# fdisk -l | grep Disk | + | |
- | Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors | + | |
- | Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors // ISCSI 구성을 위해 신규 추가된 디스크 | + | |
- | Disk / | + | |
- | Disk / | + | |
- | </ | + | |
- | + | ||
- | <code vim> | + | |
- | [root@server1 ~]# vgs | + | |
- | VG #PV #LV #SN Attr | + | |
- | VG_iscsi_Disk1 | + | |
- | VG_iscsi_Disk2 | + | |
- | centos | + | |
- | + | ||
- | [root@server1 ~]# lvs | + | |
- | LV | + | |
- | lv_iscsi_Disk1 VG_iscsi_Disk1 -wi-a----- 1020.00m | + | |
- | lv_iscsi_Disk2 VG_iscsi_Disk2 -wi-a----- | + | |
- | root | + | |
- | swap | + | |
- | </ | + | |
- | + | ||
- | **targetcli 설치 및 확인 : ** | + | |
- | <code vim> | + | |
- | # yum install targetcli | + | |
- | </ | + | |
- | <code vim> | + | |
- | # targetcli --version | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | * target service 구동 : | + | |
- | <code vim> | + | |
- | # systemctl start target | + | |
- | </ | + | |
- | + | ||
- | ** targetcli 명령어로 쉘 스크립트 실행 ** | + | |
- | <code vim> | + | |
- | [root@server1 ~]# targetcli | + | |
- | targetcli shell version 2.1.fb37 | + | |
- | Copyright 2011-2013 by Datera, Inc and others. | + | |
- | For help on commands, type ' | + | |
- | + | ||
- | /> 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 구성 ** | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ===== iSCSI 사용 ===== | + | |
- | + | ||
- | <WRAP prewrap> | + | |
- | <code bash> | + | |
- | # Discover targets at a given IP address: | + | |
- | iscsiadm --mode discoverydb --type sendtargets --portal 192.168.1.10 --discover | + | |
- | + | ||
- | #Login, must use a node record id found by the discovery: | + | |
- | iscsiadm --mode node --targetname iqn.2001-05.com.doe: | + | |
- | + | ||
- | #Logout: | + | |
- | iscsiadm --mode node --targetname iqn.2001-05.com.doe: | + | |
- | + | ||
- | #List node records: | + | |
- | iscsiadm --mode node | + | |
- | + | ||
- | #Display all data for a given node record: | + | |
- | iscsiadm --mode node --targetname iqn.2001-05.com.doe: | + | |
- | </ | + | |
- | </ | + | |