리눅스/OS 설정

[LINUX] 1. Multipath.conf 파일 설정

ㅎㄷㄹㅁㅇ 2022. 3. 13. 23:17
반응형

 

Multipath

Multipath 란?

서버의 HBA 카드의 다중 PATH가 스토리지에 있는 컨트롤러와 연결하여 한쪽 연결이 끊어져도 다른 한쪽으로 통신이 가능하게 하는 것을 말합니다. 즉, Multipath의 역할은 이중화(다중화)가 되어있는 여러 개의 물리적인 라인을 하나의 LUN으로 묶어 논리적으로 하나의 디스크로 인식시켜주는 것을 말합니다. 

(Multipath의 설치 포스팅은 추후에 쓰겠습니다. )

 

 

/etc/multipath.conf 파일 설정 값 확인

Multipath를 통해 연동할 때 보다 더 효율적으로 연동하고 관리하기 위해서는 설정 파일 확인이 필수적입니다. 

아래는 multipath.conf 파일의 default 입니다. 해당 파일의 전체적인 내용을 포스팅하기 위해 Section 별로 확인 후 세부적인 옵션을 포스팅하려고 합니다.  

 

multipath.conf default 파일
[root@test~]# cat /etc/multipath.conf 
# This is a basic configuration file with some examples, for device mapper
# multipath.
#
# For a complete list of the default configuration values, run either
# multipath -t
# or
# multipathd show config
#
# For a list of configuration options with descriptions, see the multipath.conf
# man page

## By default, devices with vendor = "IBM" and product = "S/390.*" are
## blacklisted. To enable mulitpathing on these devies, uncomment the
## following lines.
#blacklist_exceptions {
# device {
# vendor "IBM"
# product "S/390.*"
# }
#}

## Use user friendly names, instead of using WWIDs as names.
defaults {
user_friendly_names yes
find_multipaths yes
}
##
## Here is an example of how to configure some standard options.
##
#
#defaults {
# polling_interval  10
# path_selector "round-robin 0"
# path_grouping_policy multibus
# uid_attribute ID_SERIAL
# prio alua
# path_checker readsector0
# rr_min_io 100
# max_fds 8192
# rr_weight priorities
# failback immediate
# no_path_retry fail
# user_friendly_names yes
#}
##
## The wwid line in the following blacklist section is shown as an example
## of how to blacklist devices by wwid.  The 2 devnode lines are the
## compiled in default blacklist. If you want to blacklist entire types
## of devices, such as all scsi devices, you should use a devnode line.
## However, if you want to blacklist specific devices, you should use
## a wwid line.  Since there is no guarantee that a specific device will
## not change names on reboot (from /dev/sda to /dev/sdb for example)
## devnode lines are not recommended for blacklisting specific devices.
##
#blacklist {
#       wwid 26353900f02796769
# devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
# devnode "^hd[a-z]"
#}
#multipaths {
# multipath {
# wwid 3600508b4000156d700012000000b0000
# alias yellow
# path_grouping_policy multibus
# path_selector "round-robin 0"
# failback manual
# rr_weight priorities
# no_path_retry 5
# }
# multipath {
# wwid 1DEC_____321816758474
# alias red
# }
#}
#devices {
# device {
# vendor "COMPAQ  "
# product "HSV110 (C)COMPAQ"
# path_grouping_policy multibus
# path_checker readsector0
# path_selector "round-robin 0"
# hardware_handler "0"
# failback 15
# rr_weight priorities
# no_path_retry queue
# }
# device {
# vendor "COMPAQ  "
# product "MSA1000         "
# path_grouping_policy multibus
# }
#}

 

옵션 확인

Sections 설명 비고
blacklist multipath에서 특정 장치군 / device를 제외하는 섹션(옵션)입니다. 
multipath를 사용하지 않을 device를 설정합니다. 
 
blacklist_exceptions blackilst에 포함되지만 그 중 예외처리를 하는 옵션입니다. 
blacklist의 후보로도 볼 수 있으며 파라미터에 따라 blackilst 섹션에 추가 될 수 있습니다. 
 
defaults multipath의 일반적인 설정을 하는 섹션입니다.   
multipaths 각각의 multipath 별로 디바이스 셋팅을 한 값입니다.
기존의 defaults 섹션을 overwrite합니다.
 
devices 개별 스토리지 컨트롤러에 대한 설정입니다. default 섹션을 지원하지 않는다면 하위섹션으로 따로 지정해서 사용 할 수 있습니다. 
즉 각 스토리지 설정을 따로 지정하는 섹션입니다.  
 

 

* 참고
multipath 설치 이후 /etc/multipath.conf 가 보이지 않는다면, $ mpathconf --enable 명령어를 통해 생성해줍니다.  
또는 rpm -ql device-mapper-multipath | grep "multipath.conf$" 명령어를 통해 나온 결과 파일을 cp 명령어 통해 복사해서 생성해줍니다. 

아래 코드 참고

 

명령어 수행을 통한 결과 값 확인

코드
# mpathconf --enable

# cp $(rpm -ql device-mapper-multipath | grep "multipath.conf$") /etc/multipath.conf

 

결과 값
1. 
[root@test ~]# ls -ltr /etc/multipath.conf 
-rw-------. 1 root root 2415 Mar 13 22:45 /etc/multipath.conf

2. 
[root@test ~]# cp $(rpm -ql device-mapper-multipath | grep "multipath.conf$") /etc/multipath.conf
[root@test ~]# ls -ltr /etc/multipath.conf 
-rw-r--r--. 1 root root 2400 Mar 13 22:45 /etc/multipath.conf

 

Ref

* 참고 사이트 & 문헌
SAN 개념 및 iSCSI 개념 :: Las 낙서장 (tistory.com)
4.2. Configuration File Blacklist Red Hat Enterprise Linux 6 | Red Hat Customer Portal

 

 

 

반응형

'리눅스 > OS 설정' 카테고리의 다른 글

[LINUX] SWAP OFF  (0) 2023.04.28
[LINUX] 사용중인 PCI slot 확인 방법  (1) 2023.01.27
[Linux] 정리 전 명령어  (0) 2022.03.03
[리눅스] ssh port 추가  (0) 2022.02.12
[리눅스] 리눅스 online 중 파티션 증설  (0) 2022.01.20
TOP