개요
구성환경
Cent OS 7.6
1. iSCSI Target 서버 구성
[Linux] iSCSI 구성 #2 - targetcli 명령어를 이용한 구성에서 1.iSCSI Target 서버 구성 참조
2. multipath 구성(클라이언트)
2.1 device-mapper-multipath RPM 설치
shell> yum install device-mapper-multipath
2.2 multipath.conf 복사
shell> cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
** multipath.conf 는 커스텀마이징 없이 사용가능하다.
2.3 mutipath 서비스 시작
shell> systemctl --now enable multipathd
2.4 multipath 확인
shell> multipath -ll => multipath 디바이스가 구성이 없기 때문에 어떠한 Output도 없을 것이다.
3. initiator 구성(클라이언트)
3.1 ISCSI 오프로드 및 인터페이스 바인딩 구성(옵션)
- 포털과 NIC가 서로 다른 서브넷에 설정된 경우 바인딩을 위해 iSCSI 인터페이스를 수동으로 구성 할 필요가 없습니다.
shell> iscsiadm -m iface default tcp,<empty>,<empty>,<empty>,<empty> iser iser,<empty>,<empty>,<empty>,<empty> shell> iscsiadm -m iface -I iface0 --op=new => iface0은 eth0에 바인딩 shell> iscsiadm -m iface -I iface0 --op=update -n iface.hwaddress -v 08:00:27:95:39:39 => eth0의 mac address shell> iscsiadm -m iface -I iface1 --op=new => iface1은 eth1에 바인딩 shell> iscsiadm -m iface -I iface1 --op=update -n iface.hwaddress -v 08:00:27:84:c3:b3 => eth1의 mac address shell> iscsiadm -m iface default tcp,<empty>,<empty>,<empty>, <empty> iser iser,<empty>,<empty>,<empty>,<empty> iface0 tcp,08:00:27:95:39:39,<empty>,<empty>,<empty> iface1 tcp,08:00:27:84:c3:b3,<empty>,<empty>,<empty> |
* 인터페이스가 구성 정보는 /var/lib/iscsi/ifaces 디렉토리에 인터페이스 이름(예로 iface0, iface1)으로 저장된다.
3.2 Target Portal 연결 및 Target Login
shell> iscsiadm --mode discovery -I iface0 --type sendtargets --portal 172.16.0.1 -P 1 Target: iqn.2014-08.com.hoya.testsvr:t1 Portal: 172.16.0.1:3260,1 Iface Name: iface0 shell> iscsiadm --mode discovery -I iface1 --type sendtargets --portal 172.16.0.2 -P 1 Target: iqn.2014-08.com.hoya.testsvr:t1 Portal: 172.16.0.2:3260,1 Iface Name: iface1 shell> iscsiadm --mode node --login Logging in to [iface: iface0, target: iqn.2014-08.com.hoya.testsvr:t1, portal: 172.16.0.1,3260] (multiple) Logging in to [iface: iface1, target: iqn.2014-08.com.hoya.testsvr:t1, portal: 172.16.0.2,3260] (multiple) Login to [iface: iface0, target: iqn.2014-08.com.hoya.testsvr:t1, portal: 172.16.0.1,3260] successful. Login to [iface: iface1, target: iqn.2014-08.com.hoya.testsvr:t1, portal: 172.16.0.2,3260] successful. shell> |
** target login이 이루어 지면 /etc/multipath/bindings, wwids 파일에 디바이스의 path 및 wwid 정보가 등록된다.
- /etc/multipath/bindings 예시
# Format: # alias wwid # mpatha 36001405b1e88df72d034e0cafaddf112 mpathb 360014052f2c45cc9c9148e2bd1071352 |
- /etc/multipath/wwids 예시
# Valid WWIDs: /36001405b1e88df72d034e0cafaddf112/ /360014052f2c45cc9c9148e2bd1071352/ |
3.3 인터페이스 바인딩 정보
shell> iscsiadm -m iface -P 1 Iface: default Iface: iser Iface: iface0 Target: iqn.2014-08.com.hoya.testsvr:t1 Portal: 172.16.0.1:3260,1 Iface: iface1 Target: iqn.2014-08.com.hoya.testsvr:t1 Portal: 172.16.0.2:3260,1 [root@rac2 ifaces]# |
4. 확인
- multipath -ll
shell> multipath -ll mpathb (360014052f2c45cc9c9148e2bd1071352) dm-3 LIO-ORG ,iscsi_disk_sdg size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 20:0:0:1 sdp 8:240 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 19:0:0:1 sdq 65:0 active ready running mpatha (36001405b1e88df72d034e0cafaddf112) dm-2 LIO-ORG ,iscsi_disk_sdf size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 20:0:0:0 sdn 8:208 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 19:0:0:0 sdo 8:224 active ready running ----- iscsi 인터페이스 한곳이 장애가 발생했을 경우 ----- shell> multipath -ll mpathb (360014052f2c45cc9c9148e2bd1071352) dm-3 LIO-ORG ,iscsi_disk_sdg size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=active | `- 31:0:0:1 sdp 8:240 active undef running `-+- policy='service-time 0' prio=1 status=enabled `- 30:0:0:1 sdq 65:0 active ready running mpatha (36001405b1e88df72d034e0cafaddf112) dm-2 LIO-ORG ,iscsi_disk_sdf size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=active | `- 31:0:0:0 sdn 8:208 active undef running `-+- policy='service-time 0' prio=1 status=enabled `- 30:0:0:0 sdo 8:224 active ready running shell> multipath -ll mpathb (360014052f2c45cc9c9148e2bd1071352) dm-3 LIO-ORG ,iscsi_disk_sdg size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=enabled | `- 31:0:0:1 sdp 8:240 failed faulty running `-+- policy='service-time 0' prio=1 status=active `- 30:0:0:1 sdq 65:0 active ready running mpatha (36001405b1e88df72d034e0cafaddf112) dm-2 LIO-ORG ,iscsi_disk_sdf size=1.0G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=0 status=enabled | `- 31:0:0:0 sdn 8:208 failed faulty running `-+- policy='service-time 0' prio=1 status=active `- 30:0:0:0 sdo 8:224 active ready running shell> |
5. 파일시스템 생성
multipath가 구성이 되면 /dev/mapper/mpathn 형식으로 디바이스가 생성된다.
shell> fdisk -l ..... 중략 ..... Disk /dev/sdn: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes Disk /dev/sdp: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes Disk /dev/sdo: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes Disk /dev/sdq: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes Disk /dev/mapper/mpatha: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes Disk /dev/mapper/mpathb: 1073 MB, 1073741824 bytes, 2097152 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 33550336 bytes shell> |
6. 관련 파일
- /etc/multipath.conf :
- /etc/multipath/bindings :
- /etc/multipath/wwids :
'운영체제 > Unix & Linux' 카테고리의 다른 글
[Linux] iscsi Lun 마운트 오류 (4) | 2020.05.08 |
---|---|
[Linux] Disk , Disk Partion table 초기화 (0) | 2020.04.26 |
[Linux] iSCSI 구성 #2 - targetcli 명령어를 이용한 구성 (0) | 2020.04.21 |
[Linux] iSCSI 구성 #1 - tgt를 이용한 구성 (0) | 2020.04.20 |
[Linux] NFS 구성 (0) | 2020.03.31 |