실행
태스크 #12292
iSCSI 자료조사
설명
target + LIO
- 현재 ASE 버전에서 target 설치시 기본 구성
Backstore
- block
- 시스템 내 블록 장치를 공유
- filio
- 파일 시스템 중 일부를 블록장치처럼 공유
- pscsi
- CD 드라이브, 테이프 등 SCSI 장치를 공유
- ramdisk
- RAM 공간의 일부를 공유
- 휘발성
- block
TGP(Target Group Portal)
- IQN
- LUN
- ACL
- iSER 설정
- iSCSI Extentions for RDMA
- IQN
Failover
- Pacemaker
- iSCSITarget
- Target 서버의 정보등을 Failover
- iSCSILogicalUnit
- LUN 관련 내용을 Failover
- iSCSITarget
- DRBD
- Pacemaker
ALUA
- Asymetric Logical Unit Access
- LUN으로 접근 가능한 경로가 여러가지일 때 사용할 정책
- AO: Active optimized
- 최적 경로
- 성능에 이점
- 기본값
- AN: Active Non-Optimized
- 장애시 사용 가능
SCSI targets
- LIO
- TGT
- The Linux SCSI target framework
- scsi-tgt
- iET
- iSCSI Enterprise Target
- SCST
- The generic SCSI target subsystem for Linux
논의 필요¶
- 정책
- 듀얼 컨트롤러가 아니거나 DRBD, SAN 등을 사용하지 않을 경우 Failover 불가능
- 사용 강제 / 생성시 유의 / 생성 불가 등
- 듀얼 컨트롤러가 아니거나 DRBD, SAN 등을 사용하지 않을 경우 Failover 불가능
김 성은님이 약 일년 전에 변경
iSCSI 구성 방법¶
iSCSI Target 설치¶
- yum install targetcli
- systemctl enable target --now
Target 설정¶
targetclibackstore/block/ create dev=/dev/mapper/maptha name=lun0iscsi/ create wwn=iqn.2025-10.xxx.yyyiscsi/iqn.2025-10.xxx.yyy/tpg1/luns create /backstores/block/lun0iscsi/iqn.2025-10.xxx.yyy/tpg1/portals create 서비스IP ip_port=포트번호
DRBD + iSCSI 구성 방법¶
iSCSI Target 설치¶
- yum install targetcli
- systemctl enable target --now
DRBD 설치¶
다운로드¶
wget https://linbit.gateway.scarf.sh//downloads/drbd/9/drbd-9.2.14.tar.gzwget https://linbit.gateway.scarf.sh//downloads/drbd/utils/drbd-utils-9.32.0.tar.gztar -xvf drbd-9.2.14.tar.gztar -xvf drbd-utils-9.32.0.tar.gz
DRBD 빌드 및 설치¶
yum install -y kernel-devel kernel-headers gcc flexcd drbd-9.2.14makemake installmodprobe drbdcd -
DRBD util 빌드 및 설치¶
cd drbd-utils-9.32.0./configuremakeUserland tools build was successful나오면 빌드 자체는 성공
make install
DRBD 구성¶
모든 노드에서 vim /usr/local/etc/drbd.d/test.res 아래 내용 작성
resource test {
protocol C;
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
resync-rate 300M;
}
net {
timeout 30; # 3 seconds (unit = 0.1 seconds)
connect-int 5; # 5 seconds (unit = 1 second)
ping-int 5; # 5 seconds (unit = 1 second)
max-buffers 20000;
max-epoch-size 20000;
}
on iSCSITest-1 {
device /dev/drbd1;
disk /dev/sdb;
address 31.31.31.1:7788;
meta-disk internal;
}
on iSCSITest-2 {
device /dev/drbd1;
disk /dev/sdb;
address 31.31.31.2:7788;
meta-disk internal;
}
}
- 모든 노드에서
drbdadm create-md test - 모든 노드에서
drbdadm up test - 1번 노드에서
drbdadm primary test --force
Pacemaker 구성¶
Web-UI 에서 service 템플릿까지 생성 후 진행
# 템플릿 생성 후 환경
Clone Set: rsc_bond1-group-clone [rsc_bond1-group]
Started: [ iSCSItest-1 iSCSItest-2 ]
Clone Set: Service-group-clone [Service-group]
Started: [ iSCSItest-1 iSCSItest-2 ]
Resource Group: VIP-group-1
vip_32.32.32.1 (ocf::heartbeat:IPaddr2): Started iSCSItest-2
리소스 생성¶
pcs resource create drbd ocf:linbit:drbd drbd_resource=test ignore_missing_notifications=true drbdconf='/usr/local/etc/drbd.conf'pcs resource create target ocf:heartbeat:iSCSITarget iqn='iqn.2025-09.com.test' portals='32.32.32.1:1444'pcs resource create lun0 ocf:heartbeat:iSCSILogicalUnit lun=0 path=/dev/drbd1 target_iqn=iqn.2025-09.com.test
그룹화¶
pcs resource master drbd- 이때 생성되는 Master/Slave 클론은
drbd-master
- 이때 생성되는 Master/Slave 클론은
pcs resource group add iscsi target lun0
제약조건 추가¶
pcs constraint colocation add started VIP-group-1 with master drbd-master- VIP 그룹이 올라가 있는 노드가 Master
pcs constraint colocation add master drbd-master with started iscsi- drbd Master 노드에서 iscsi target 제공
최종 구성¶
[root@iSCSItest-2 ~]# pcs status
Cluster name: iSCSItest
Stack: corosync
Current DC: iSCSItest-1 (version 2.0.0-4.el7-8cf3fe749e) - partition with quorum
Last updated: Mon Sep 22 17:31:27 2025
Last change: Mon Sep 22 17:29:15 2025 by root via cibadmin on iSCSItest-1
2 nodes configured
15 resources configured
Online: [ iSCSItest-1 iSCSItest-2 ]
Full list of resources:
Clone Set: rsc_bond1-group-clone [rsc_bond1-group]
Started: [ iSCSItest-1 iSCSItest-2 ]
Clone Set: Service-group-clone [Service-group]
Started: [ iSCSItest-1 iSCSItest-2 ]
Resource Group: VIP-group-1
vip_32.32.32.1 (ocf::heartbeat:IPaddr2): Started iSCSItest-2
Master/Slave Set: drbd-master [drbd]
Masters: [ iSCSItest-2 ]
Slaves: [ iSCSItest-1 ]
Resource Group: iscsi
target (ocf::heartbeat:iSCSITarget): Started iSCSItest-2
lun0 (ocf::heartbeat:iSCSILogicalUnit): Started iSCSItest-2
standby / unstandby 확인 완료
추가 고려 사항¶
DRBD를 사용하지 않을 경우¶
- 위에서 DRBD 와 관련된 내용을 수행하지 하지 않음
ocf:heartbeat:iSCSILogicalUnit리소스 에이전트 생성시path값을 SAN에서 받아온LUN경로로 변경
DRBD + LVM 환경 설정 시¶
현재 Web-UI 에서는 설정 불가
추가적인 constraint 설정 필요 할 것으로 예상됨
pcs constraint colocation add master drbd-master with started Filesystem_RA
실행