1. LVM 생성

[root@accon1 ~]# pvcreate /dev/mapper/mpatha

WARNING: ext4 signature detected on /dev/mapper/mpatha at offset 1080. Wipe it? [y/n]: y

Wiping ext4 signature on /dev/mapper/mpatha.

Physical volume "/dev/mapper/mpatha" successfully created.

[root@accon1 ~]# vgcreate -cy vg_cluster /dev/mapper/mpatha

Clustered volume group "vg_cluster" successfully created

[root@accon1 ~]#  lvcreate -l100%FREE -n lv_cluster vg_cluster

Logical volume "lv_cluster" created.

2. GPT설정

[root@accon1 ~]# parted /dev/mapper/vg_cluster-lv_cluster

(parted) mklabel gpt

(parted) unit gb

(parted) mkpart primary 0 100%

(parted) print

Model: Linux device-mapper (linear) (dm)

Disk /dev/mapper/vg_cluster-lv_cluster: 5.36GB

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

Partition Table: gpt

Disk Flags:

Number  Start   End     Size    File system  Name     Flags

1      0.01GB  5.35GB  5.34GB               primary

(parted) q

Information: You may need to update /etc/fstab.

3.  gfs2 파일 포맷 시 "장치나 자원이 동작중"

[root@accon1 ~]# mkfs.gfs2 -p lock_dlm -t gfs_cluster:gfs2 -j 2 /dev/vg_cluster/lv_cluster

/dev/vg_cluster/lv_cluster: 장치나 자원이 동작 중

위 방법이 안되어 mkfs.gfs2로 포맷후 GPT설정 한 화면입니다.

[root@accon1 ~]# mkfs.gfs2 -p lock_dlm -t gfs_cluster:gfs2 -j 2 /dev/vg_cluster/lv_cluster

It appears to contain a partition table (dos).

/dev/vg_cluster/lv_cluster is a symbolic link to /dev/dm-3

This will destroy any data on /dev/dm-3

Are you sure you want to proceed? [y/n] y

Discarding device contents (may take a while on large devices): Done

Adding journals: Done

Building resource groups: Done

Creating quota file: Done

Writing superblock and syncing: Done

Device:                    /dev/vg_cluster/lv_cluster

Block size:                4096

Device size:               4.99 GB (1308672 blocks)

Filesystem size:           4.99 GB (1308668 blocks)

Journals:                  2

Journal size:              32MB

Resource groups:           22

Locking protocol:          "lock_dlm"

Lock table:                "gfs_cluster:gfs2"

UUID:                      15263441-bd6c-4f69-8867-e06e0d806aa5

[root@accon1 ~]# mkdir /gfs

[root@accon1 ~]# pcs resource create fs_gfs Filesystem device="/dev/mapper/vg_cluster-lv_cluster" directory="/gfs" fstype="gfs2" options="noatime,nodiratime" op monitor interval=10s on-fail=fence clone  interleave=true --force

Assumed agent name 'ocf:heartbeat:Filesystem' (deduced from 'Filesystem')

[root@accon1 ~]#PCs status

Node accon1: UNCLEAN (online)

Online: [ accon2 ]

Full list of resources:

scsi   (stonith:fence_scsi):   Stopped

Clone Set: dlm-clone [dlm]

Started: [ accon1 accon2 ]

Clone Set: clvmd-clone [clvmd]

clvmd      (ocf::heartbeat:clvm):  FAILED accon1

Started: [ accon2 ]

Clone Set: fs_gfs-clone [fs_gfs]

Stopped: [ accon1 accon2 ]

Failed Resource Actions:

* clvmd_stop_0 on accon1 'unknown error' (1): call=32, status=complete, exitreason='Failed to deactivate volume groups, cluster vglist = vg_cluster',

last-rc-change='Wed Oct 21 21:33:45 2020', queued=0ms, exec=2169ms

* fs_gfs_start_0 on accon1 'unknown error' (1): call=27, status=complete, exitreason='Couldn't mount device [/dev/mapper/vg_cluster-lv_cluster] as /gfs',

last-rc-change='Wed Oct 21 21:29:09 2020', queued=0ms, exec=111ms

Failed Fencing Actions:

* reboot of accon1 failed: delegate=accon2, client=crmd.1296, origin=accon1,

last-failed='Wed Oct 21 21:45:27 2020'

Pending Fencing Actions:

* reboot of accon1 pending: client=crmd.1296, origin=accon1

Daemon Status:

corosync: active/enabled

pacemaker: inactive/enabled

pcsd: active/enabled