FibreChannel 디스크가 다른 곳에 설치되어 있는지 확인

FibreChannel 디스크가 다른 곳에 설치되어 있는지 확인

두 대의 RHEL 6.5 서버가 있습니다. 각각은 다중 경로 지정 및 LVM을 사용하여 동일한 FibreChannel LUN에 액세스할 수 있습니다 /dev/mapper/vg0-lv_shared.

lv_sharedserver1 또는 server2에 설치할 수 있지만 둘 다에 설치할 수는 없습니다. 클러스터 서비스를 사용할 수 없어서 간단한 스크립트를 작성합니다.

lv_shared서버간 SSH 연결이 안되는 경우, server2가 설치되어 있는지 server1에서 확인할 수 있나요?
즉, server1에 사용 가능한 디스크가 다른 곳에 마운트되어 있는지 어떻게 확인합니까?

답변1

이는 일반적으로 LVM 태그(LVM2부터 사용 가능)를 통해 수행됩니다. 다음은 이를 보여주는 간단한 예입니다.

2개의 LV "lvtest"와 "lvother"가 있는 "vg01"이라는 VG가 있다고 가정해 보겠습니다.

[root@centos ~]# lvs vg01
  LV      VG   Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert
  lvother vg01 -wi------- 12.00m
  lvtest  vg01 -wi------- 12.00m

이제 LVM 호스트 태그를 활성화합니다:

[root@centos ~]# grep ^tags /etc/lvm/lvm.conf
tags { hosttags = 1 }

그리고 호스트 이름을 기반으로 활성화 필터를 설정하십시오.

[root@centos ~]# cat /etc/lvm/lvm_centos.conf (centos.conf == hostname.conf)
activation { volume_list=["@centos"] }

이제 일부 태그를 확인/설정/제거해 보겠습니다.

[root@centos ~]# lvs vg01 -o +tags
 LV      VG   Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert LV Tags
 lvother vg01 -wi------- 12.00m
 lvtest  vg01 -wi------- 12.00m

현재 설정된 라벨이 없습니다(마지막 열).

볼륨 활성화가 작동하지 않습니다:

[root@centos ~]# vgchange -ay /dev/vg01
 Not activating vg01/lvtest since it does not pass activation filter.
 Not activating vg01/lvother since it does not pass activation filter.
 0 logical volume(s) in volume group "vg01" now active

태그를 추가하고 다시 시도해 보겠습니다.

[root@centos ~]# lvchange --addtag @centos /dev/vg01/lvtest
 Logical volume "lvtest" changed.

[root@centos ~]# lvchange --addtag @centos /dev/vg01/lvother
 Logical volume "lvother" changed.

[root@centos ~]# lvs vg01 -o +tags
 LV      VG   Attr       LSize  Pool Origin Data%  Move Log Cpy%Sync Convert LV Tags
 lvother vg01 -wi------- 12.00m                                              centos
 lvtest  vg01 -wi------- 12.00m                                              centos

[root@centos ~]# vgchange -ay /dev/vg01
 2 logical volume(s) in volume group "vg01" now active

더 나은 것. ;-)

lv_shared따라서 귀하의 경우에는 LV가 마운트되어야 하는 서버의 호스트 이름에 레이블을 설정해야 합니다.

관련 정보