반응형
■ GFS2 (Global File System 2)
위키백과 : https://en.wikipedia.org/wiki/GFS2#cite_note-3
OS : CentOS6.x
■ hosts 수정 및 방화벽 off
vi /etc/hosts
192.168.0.4 node1
192.168.0.6 node2
iptables 및 selinux off
■ cluster conf 수정
vi /etc/cluster/cluster.conf
<?xml version="1.0"?>
<cluster config_version="1" name="cluster">
<clusternodes>
<clusternode name="node1" nodeid="1"/>
<clusternode name="node2" nodeid="2"/>
</clusternodes>
<cman expected_votes="1" two_node="1"/>
<fencedevices/>
<rm/>
</cluster>
■ LVM 볼륨 생성
pvcreate /dev/sdb
vgcreate -Ay -cy VoL00 /dev/sdb
lvcreate -L +2G -n test VoL00
■ 파일시스템 생성
[root@node1 ~]# mkfs.gfs2 -p lock_dlm -t cluster:gfs2 -j 2 /dev/VoL00/test
This will destroy any data on /dev/VoL00/test.
It appears to contain: symbolic link to `../dm-2'
Are you sure you want to proceed? [y/n] y
Device: /dev/VoL00/test
Blocksize: 4096
Device Size 2.00 GB (523264 blocks)
Filesystem Size: 2.00 GB (523264 blocks)
Journals: 2
Resource Groups: 8
Locking Protocol: "lock_dlm"
Lock Table: "cluster:gfs2"
UUID: 166520af-2f53-741f-78ea-7154edeba9ce
■ GFS2 파일시스템 마운트 및 테스트
[root@node1 gfs]# mount -t gfs2 /dev/VoL00/test /gfs
[root@node1 gfs]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VoL00-test
2.0G 259M 1.8G 13% /gfs
■ Reboot 후 자동 mount 를 위해 fstab수정
vi /etc/fstab
# /etc/fstab
# Created by anaconda on Mon Apr 12 15:11:03 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/VolGroup-lv_root / ext4 defaults 1 1
UUID=ef56ba7f-4125-490b-aae8-59eaadcbf284 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VoL00/gfs /gfs gfs2 defaults 0 0
■ GFS2 파일시스템 테스트
#Node1 에서 파일생성
[root@node1 gfs]# touch /gfs/1
[root@node1 gfs]# ll /gfs
합계 12
-rw-r--r-- 1 root root 0 2021-04-13 17:09 1
#Node2 에서 확인
[root@node2 gfs]# ll /gfs/
합계 12
-rw-r--r-- 1 root root 0 2021-04-13 17:09 1
반응형
'👨🏻💻Infra > 📡HA' 카테고리의 다른 글
CentOS7 Pacemaker + Corosync (1) | 2021.03.31 |
---|---|
CentOS7 DRBD (0) | 2021.03.29 |
CentOS6 Heartbeat (0) | 2019.10.22 |