본문 바로가기
Backup Solution & IT Study/OS

[Linux]Centos,Redhat MPIO 설정

by DellEMC Backup Engineer 2021. 3. 5.

# yum -y install device-mapper-multipath

 

# systemctl start multipathd

 

# systemctl enable multipathd

 

# multipathd.conf 설정 확인

======================================================

[root@testdb01 /]# 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

# }

#}

devices {

device {

vendor "DGC"

product ".*"

product_blacklist "LUNZ"

path_grouping_policy "group_by_prio"

path_checker "emc_clariion"

features "1 queue_if_no_path"

hardware_handler "1 emc"

prio "emc"

failback immediate

rr_weight "uniform"

no_path_retry 60

retain_attached_hw_handler yes

detect_prio yes

}

}

EMC 부분 추가

======================================================

 

# fdisk -l 인식 확인

scsi-rescan

 

Disk /dev/sdd: 161.1 GB, 161061273600 bytes, 314572800 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 4194304 bytes

 

 

Disk /dev/sde: 161.1 GB, 161061273600 bytes, 314572800 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 4194304 bytes

 

 

# multipath 상태 확인

 

# # multipath -l

mpathd (360060160f97049000f4d11606431a301) dm-5 DGC ,VRAID

size=150G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw

|-+- policy='service-time 0' prio=0 status=active

| `- 15:0:0:1 sdd 8:48 active undef running

`-+- policy='service-time 0' prio=0 status=enabled

`- 16:0:0:1 sde 8:64 active undef running

 

# 바인딩 이름 변경 ( 변경 시 Reboot )

[root@testdb01 etc]# vi /etc/multipath/bindings

# Multipath bindings, Version : 1.0

# NOTE: this file is automatically maintained by the multipath program.

# You should not need to edit this file in normal circumstances.

#

# Format:

# alias wwid

#

mpatha 360060160f9704900e826116002b4566a

mpathb 360060160f9704900a03a1160d08673d2

mpathc 360060160f9704900234311608c2cec86

mpathd 360060160f97049000f4d11606431a301

 

 

 

디스크 구성 정보 확인

[root@testdb01 etc]# multipath -l

mpathd (360060160f97049000f4d11606431a301) dm-5 DGC ,VRAID

size=150G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw

|-+- policy='service-time 0' prio=0 status=active

| `- 15:0:0:1 sdd 8:48 active undef running

`-+- policy='service-time 0' prio=0 status=enabled

`- 16:0:0:1 sde 8:64 active undef running

 

ls -lrt /dev/dm-*

brw-rw---- 1 root disk 253, 0 Jan 27 19:52 /dev/dm-0

brw-rw---- 1 root disk 253, 1 Jan 27 19:52 /dev/dm-1

brw-rw---- 1 root disk 253, 3 Jan 27 19:52 /dev/dm-3

brw-rw---- 1 root disk 253, 4 Jan 27 20:05 /dev/dm-4

brw-rw---- 1 root disk 253, 2 Jan 27 20:13 /dev/dm-2

brw-rw---- 1 root disk 253, 5 Jan 27 20:22 /dev/dm-5

 

Physical Volume 생성

[root@testdb01 ~]# pvcreate /dev/dm-5

Physical volume "/dev/dm-5" successfully created.

 

pvdiskplay

[root@testdb01 ~]# pvdisplay

"/dev/mapper/mpathd" is a new physical volume of "150.00 GiB"

--- NEW Physical volume ---

PV Name /dev/mapper/mpathd

VG Name

PV Size 150.00 GiB

Allocatable NO

PE Size 0

Total PE 0

Free PE 0

Allocated PE 0

PV UUID liHiwl-hXJn-ch9g-gsAs-Ce3k-FQsK-B45oGK

 

 

Virtual Volume 생성

[root@testdb01 ~]# vgcreate vg02 /dev/dm-5

Volume group "vg02" successfully created

 

[root@testdb01 ~]# vgdisplay

--- Volume group ---

VG Name vg02

System ID

Format lvm2

Metadata Areas 1

Metadata Sequence No 1

VG Access read/write

VG Status resizable

MAX LV 0

Cur LV 0

Open LV 0

Max PV 0

Cur PV 1

Act PV 1

VG Size <150.00 GiB

PE Size 4.00 MiB

Total PE 38399

Alloc PE / Size 0 / 0

Free PE / Size 38399 / <150.00 GiB

VG UUID ZwRBH8-vGu9-7HFK-5tHc-ojWb-YKWO-PI2mqS

 

Local Volume 생성

[root@testdb01 ~]# lvcreate -l 38399 vg02

Logical volume "lvol0" created.

 

[root@testdb01 ~]# lvdisplay

--- Logical volume ---

LV Path /dev/vg02/lvol0

LV Name lvol0

VG Name vg02

LV UUID 2b9MWS-fvtK-H4FU-eP5P-TElI-piOG-oyCemY

LV Write Access read/write

LV Creation host, time testdb01, 2021-01-27 20:39:59 +0900

LV Status available

# open 0

LV Size <150.00 GiB

Current LE 38399

Segments 1

Allocation inherit

Read ahead sectors auto

- currently set to 256

Block device 253:6

 

파일시스템 생성

[root@testdb01 ~]# mkfs.xfs /dev/vg02/lvol0

meta-data=/dev/vg02/lvol0 isize=512 agcount=4, agsize=9830144 blks

= sectsz=512 attr=2, projid32bit=1

= crc=1 finobt=0, sparse=0

data = bsize=4096 blocks=39320576, imaxpct=25

= sunit=0 swidth=0 blks

naming =version 2 bsize=4096 ascii-ci=0 ftype=1

log =internal log bsize=4096 blocks=19199, version=2

= sectsz=512 sunit=0 blks, lazy-count=1

realtime =none extsz=4096 blocks=0, rtextents=0

 

fs탭 등록

[root@testdb01 /]# cat /etc/fstab

 

#

# /etc/fstab

# Created by anaconda on Wed Jan 27 16:18:59 2021

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

/dev/mapper/centos-root / xfs defaults 0 0

UUID=64d4ba56-6728-435f-8f5a-3f43f02217dd /boot xfs defaults 0 0

/dev/mapper/centos-home /home xfs defaults 0 0

/dev/mapper/centos-swap swap swap defaults 0 0

/dev/vg02/lvol0 /data01 xfs defaults 0 0

 

[root@testdb01 /]# mount -a

[root@testdb01 /]# df -h

Filesystem Size Used Avail Use% Mounted on

devtmpfs 32G 0 32G 0% /dev

tmpfs 32G 4.0K 32G 1% /dev/shm

tmpfs 32G 11M 32G 1% /run

tmpfs 32G 0 32G 0% /sys/fs/cgroup

/dev/mapper/centos-root 1.0T 4.9G 1020G 1% /

/dev/sda1 1014M 187M 828M 19% /boot

/dev/mapper/centos-home 47G 33M 47G 1% /home

tmpfs 6.3G 12K 6.3G 1% /run/user/42

tmpfs 6.3G 0 6.3G 0% /run/user/0

/dev/mapper/vg02-lvol0 150G 33M 150G 1% /data01

 

==Path 삭제

multipath -ll 확인

scsi-rescan 다시 스켄

 

[root@testdb01 ~]# multipath -ll

mpathd (360060160f97049000f4d11606431a301) dm-5 DGC ,VRAID

size=150G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw

|-+- policy='service-time 0' prio=0 status=enabled

| `- 15:0:0:1 sdd 8:48 failed faulty running

`-+- policy='service-time 0' prio=0 status=enabled

`- 16:0:0:1 sde 8:64 failed faulty running

mpathc (360060160f9704900234311608c2cec86) dm-2 DGC ,VRAID

size=50G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw

|-+- policy='service-time 0' prio=0 status=enabled

| `- 16:0:0:0 sdc 8:32 failed faulty running

`-+- policy='service-time 0' prio=0 status=enabled

`- 15:0:0:0 sdb 8:16 failed faulty running

 

[root@testdb01 ~]# systemctl restart multipathd

[root@testdb01 ~]# fdisk -l 제거 확인

 

[root@testdb01 ~]# multipath -ll

mpathd (360060160f97049000f4d11606431a301) dm-5

size=150G features='0' hwhandler='0' wp=rw

mpathc (360060160f9704900234311608c2cec86) dm-2

size=50G features='0' hwhandler='0' wp=rw

 

삭제

multipath -f mpathc

multipath -f mpathd

 

[root@testdb01 etc]# vi /etc/multipath/bindings

# Multipath bindings, Version : 1.0

# NOTE: this file is automatically maintained by the multipath program.

# You should not need to edit this file in normal circumstances.

#

# Format:

# alias wwid

#

 

reboot

 

 

 

=====================

Lun 다른 서버 Mount

[root@testdb02 ~]# multipath -ll

mpathc (360060160f97049000f4d11606431a301) dm-2 DGC ,VRAID

size=150G features='2 queue_if_no_path retain_attached_hw_handler' hwhandler='1 alua' wp=rw

|-+- policy='service-time 0' prio=50 status=active

| `- 16:0:0:0 sdc 8:32 active ready running

`-+- policy='service-time 0' prio=10 status=enabled

`- 15:0:0:0 sdb 8:16 active ready running

 

[root@testdb02 /]# mount /dev/mapper/vg02-lvol0 /data

 

 

 

'Backup Solution & IT Study > OS' 카테고리의 다른 글

[Linux]tar 압축 방법  (0) 2021.03.05
[Linux]SELinux Disable 방법  (0) 2021.03.05
[Windows]cmd 를 이용한 Version 확인방법  (407) 2021.03.05
[Linux]find 명령어  (0) 2021.03.02
[Linux]linux Crontab 설정  (0) 2021.03.02

댓글