본문 바로가기
IT/lifekeeper

Lifekeeper 클러스터 복제볼륨 사이즈 변경하기 mirror_resize

by 방구석꼰머 2022. 10. 20.
반응형

Lifekeeper는 복제볼륨 리소스의 볼륨 사이즈 변경 지원을 위한 “mirror_resize” 명령어를 제공합니다. 이번 포스팅에서는 Lifekeeper에서 mirror_resize 명령을 통해 복제볼륨 사이즈를 변경하는 방법에 대해 알아보도록 하겠습니다.

 

이 포스팅은 아래의 버전에서 테스트한 내용을 기반으로 작성하였습니다
Linux : Red Hat Enterprise Linux release 8.6 
Lifekeeper : LifeKeeper for Linux 9.6.2

개요
1. mirror_resize 명령의 사용방법
2. mirror_resize 명령으로 복제볼륨 size 변경하기
3. 변경된 사이즈로 파일시스템 증설

 

 

1. mirror_resize 명령의 사용방법

mirror_resize 명령의 형식

Usage : mirror_resize [-f] [-s <size>] <tag>

  • <tag> : mirror_resize 으로 컨트롤할 복제복륨의 tag입니다.
  • [-f] : 강제조치가 필요할 경우 사용하며, 볼륨 재동기화 도 강제로 수행됩니다.
  • [-s <size>] : 변경되는 볼륨의 사이즈를 KB 단위로 지정합니다.

 

mirror_resize 명령 사용을 위한 전제조건

복제볼륨은 LV 로 구성된 볼륨 이어야 합니다.

단일 복제 타깃만 지원되며, 멀티 타깃 구성에서는 mirror_resize 가 지원되지 않습니다.

mirror_resize 명령을 사용하기 전에 Active – Standby 서버에서 변경 대상 볼륨의 사이즈를 변경해야 합니다.

 

lvm 볼륨 증설에 대한 자세한 정보는 아래의 링크에서 확인할 수 있습니다.

2022.10.19 - [IT/linux] - Redhat linux 8 LVM 볼륨 증설방법

 

Redhat linux 8 LVM 볼륨 증설방법

이번 포스팅에서는 Redhat linux 8 서버에서 lv 볼륨의 공간이 부족할 경우 lv의 공간을 증설하는 방법과 과정에 대해 알아보도록 하겠습니다. 이 포스팅은 아래의 버전에서 테스트한 내용을 기반으

justdaily.tistory.com

 

2. mirror_resize 명령으로 복제볼륨 사이즈 변경하기

클러스터 정보 확인

Lifekeeper 클러스터 정보를 먼저 확인합니다.

클러스터 상태 확인에 대한 자세한 정보는 아래의 링크에서 확인할 수 있습니다.

2022.09.23 - [IT/lifekeeper] - Lifekeeper 클러스터 상태 확인하기 lcdstatus

 

Lifekeeper 클러스터 상태 확인하기 lcdstatus

이번 포스팅에서는 Lifekeeper 클러스터의 구성정보와 상태를 확인할 수 있는 “lcdstatus” 명령어의 사용 방법에 대해 알아보도록 하겠습니다. 이 포스팅은 아래의 버전에서 테스트한 내용을 기반

justdaily.tistory.com

 

# lcdstatus -q

# lcdstatus -q
LOCAL     TAG                    ID                         STATE     PRIO  PRIMARY
server01  pgsql-5432             server01.pgsql-5432        ISP          1  server01
server01   /data                 /data                      ISP          1  server01
server01    datarep-data         /dev/mapper/testvg-testlv  ISP          1  server01
server01     ip-192.168.240.205  IP-192.168.240.205         ISP          1  server01

MACHINE   NETWORK ADDRESSES/DEVICE                 STATE     PRIO
server02  TCP     192.168.240.194/192.168.240.195  ALIVE        1
server02  TCP     192.168.240.199/192.168.240.200  ALIVE        2

 

반응형

 

복제볼륨 동기화 상태 확인

사이즈 변경 대상 볼륨의 동기화 상태를 확인합니다.

복제볼륨 동기화 상태에 대한 자세한 정보는 아래의 링크에서 확인할 수 있습니다.

2022.09.25 - [IT/lifekeeper] - Lifekeeper 복제볼륨 동기화 상태 확인하기 mirror_status

 

Lifekeeper 복제볼륨 동기화 상태 확인하기 mirror_status

이번 포스팅에서는 Lifekeeper로 구성된 복제볼륨 리소스의 동기화 상태를 확인할 수 있는 “mirror_status” 명령어의 사용 방법에 대해 알아보도록 하겠습니다. 이 포스팅은 아래의 버전에서 테스트

justdaily.tistory.com

 

# mirror_status datarep-data

# mirror_status datarep-data
Mirror Configuration:
[ ]     server01 -> server02 (192.168.240.195)
        Status: Fully Operational
        [===================>] 100%
        Type: Synchronous

Bitmap: 20480 bits (chunks), 0 dirty (0.0%)
  • 현재 bitmap 은 20480 bits 입니다.

 

lv 정보 조회

사이즈 변경 대상 lv의 정보를 확인합니다.

lv의 정보 조회에 대한 자세한 정보는 아래의 링크에서 확인할 수 있습니다.

2022.10.18 - [IT/linux] - Linux LVM LV attr 정보 조회

 

Linux LVM LV attr 정보 조회

이번 포스팅에서는 Linux 서버 LVM에서 LV의 정보를 조회할 수 있는 “lvs” 명령어와 관련 lv 정보에 대해 자세히 알아보도록 하겠습니다. 이 포스팅은 아래의 버전에서 테스트한 내용을 기반으로

justdaily.tistory.com

 

# lvs

# lvs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  testlv  testvg -wi-ao----   5.00g
  testlv2 testvg -wi-ao---- <15.00g
  • 현재 5G가 할당된 testlv의 사이즈를 1G 증설해 보도록 하겠습니다.

 

증설 대상 lv 사이즈 증설

# lvextend -L +1G /dev/testvg/testlv

# lvextend -L +1G /dev/testvg/testlv
  Size of logical volume testvg/testlv changed from 5.00 GiB (1280 extents) to 6.00 GiB (1536 extents).
  Logical volume testvg/testlv successfully resized.

 

lv 볼륨 증설 확인

# lvs

# lvs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  testlv  testvg -wi-ao----   6.00g
  testlv2 testvg -wi-ao---- <15.00g
  • Active – Standby 서버 모두 동일하게 증설합니다.

 

 

mirror_resize 로 동기화 볼륨 사이즈 변경

Active 서버에서 아래의 명령을 수행하여 복제볼륨의 사이즈를 변경합니다.

# mirror_resize datarep-data

# mirror_resize datarep-data

Resize mirror datarep-data (/dev/md0) from 5.0 GB to 6.0 GB ?
WARNING: This will cause a full resynchronization.
Are you sure (y/n) ?
  • 변경되는 사이즈 정보를 확인하고 “y”를 입력하여 계속 진행합니다.

 

The mirror datarep-data will now be resized from 5242880 KB (5.0 GB) to 6291456 KB (6.0 GB).
Pausing mirror datarep-data: server01 -> server02...
The mirror to server02 has been paused
Temporary read/write access for datarep-data set up on the mount point "/data" on server server02. You must access the data from this mount point ONLY! All changes made to the data on server "server02" via the mount point "/data" will be DISCARDED when the mirror is resumed.
/opt/LifeKeeper/lkadm/subsys/scsi/netraid/bin/mdadm --grow /dev/md0 --bitmap=none
/opt/LifeKeeper/lkadm/subsys/scsi/netraid/bin/mdadm --grow /dev/md0 --size=6291456
mdadm: component size of /dev/md0 has been set to 6291456K
Resizing bitmap on server02
lcdremexec -d server02 -e -- bitmap -x 6291456 /opt/LifeKeeper/bitmap__data
Extending bitmap by 512 bytes
Resizing bitmap on server01
lcdremexec -d server01 -e -- bitmap -x 6291456 /opt/LifeKeeper/bitmap__data
Extending bitmap by 512 bytes
/opt/LifeKeeper/lkadm/subsys/scsi/netraid/bin/mdadm --grow /dev/md0 --bitmap=/opt/LifeKeeper/bitmap__data --bitmap-chunk=256 --force
assume non-persistent superblock
: No such file or directory
Forcing full resync...
Resuming mirror datarep-data: server01 -> server02...
mdadm: stopped /dev/md0
Set full resync to target server02.
Full resynchronization of component "/dev/nbd1" has begun for mirror "/dev/md0"
The mirror to server02 has been resumed
The mirror datarep-data has been resized from 5242880 KB (5.0 GB) to 6291456 KB (6.0 GB).
  • 복제볼륨의 사이즈가 5GB에서 6GB로 변경되었으며, 자동으로 full resync를 진행합니다.

 

복제볼륨 사이즈 변경
복제볼륨 사이즈 변경

 

볼륨 동기화 상태 확인

# mirror_status datarep-data

# mirror_status datarep-data
Mirror Configuration:
[ ]     server01 -> server02 (192.168.240.195)
        Status: Fully Operational
        [===================>] 100%
        Type: Synchronous

Bitmap: 24576 bits (chunks), 0 dirty (0.0%)
  • 사이즈 변경 후 bitmap이 24576 bits로 변경되고, 재동기화가 수행되었습니다.

 

3. 변경된 사이즈로 파일 시스템 증설

변경된 사이즈로 파일 시스템을 증설하는 과정을 추가로 진행합니다.

파일시스템 증설 시 대상은 복제볼륨 디바이스로 지정해야 합니다.

파일 시스템 증설에 대한 자세한 정보는 아래의 링크에서 확인할 수 있습니다.

 

# xfs_growfs /dev/md0

# xfs_growfs /dev/md0
meta-data=/dev/md0               isize=512    agcount=4, agsize=327680 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1    bigtime=0 inobtcount=0
data     =                       bsize=4096   blocks=1310720, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
  • 사이즈를 증설한 /data의 마운트 디바이스인 /dev/md0를 지정하여 확장

 

볼륨 변경정보 확인

[root@server01 ~]# df -Th
Filesystem                 Type      Size  Used Avail Use% Mounted on
devtmpfs                   devtmpfs  875M     0  875M   0% /dev
tmpfs                      tmpfs     893M   16K  893M   1% /dev/shm
tmpfs                      tmpfs     893M   18M  875M   3% /run
tmpfs                      tmpfs     893M     0  893M   0% /sys/fs/cgroup
/dev/nvme0n1p3             xfs        28G  7.3G   21G  27% /
/dev/nvme0n1p1             xfs       295M  189M  107M  64% /boot
tmpfs                      tmpfs     179M   12K  179M   1% /run/user/42
/dev/md0                   xfs       6.0G  115M  5.9G   2% /data
tmpfs                      tmpfs     179M     0  179M   0% /run/user/26
tmpfs                      tmpfs     179M     0  179M   0% /run/user/0
  • /data가 6G로 변경된 것을 확인할 수 있습니다.

 

지금까지 Lifekeeper의 mirror_resize 명령어의 사용방법에 대해 알아봤습니다.

 

감사합니다.

반응형

댓글