티스토리 뷰
glusterfs 설치
다운로드 및 repo 페이지
https://download.gluster.org/pub/gluster/glusterfs/
centos8 (repo 저장) 최신 다운로드
wget https://download.gluster.org/pub/gluster/glusterfs/LATEST/CentOS/glusterfs-rhel8.repo -P /etc/yum.repos.d/
테스트 환경
virtualbox VM, CENTOS7 64bit, sdb 10G 추가
host 이름으로 서로 통신
/etc/hosts
192.168.56.7 glusterfs1
192.168.56.8 glusterfs2
: 아이피 및 도메인으로도 통신 가능함
glusterfs 버젼 검색
yum search centos-release-gluster
SIG 저장소를 사용하기 위한 centos-release-gluster 설치
yum install centos-release-gluster312
: yum install centos-release-gluster (버전 명시 없으면 최신버젼으로 지정)
xfs 파티션 준비 (선택)
mkfs.xfs -i size=512 /dev/sdx
mkdir -p /bricks/brick1
: XFS 파일시스템으로 포맷 (권장)
: 별도의 디스크나 / root 파티션이 아닌 공간을 지정하는것을 권장함
/etc/fstab
/dev/sdb /bricks/brick1 xfs defaults 1 2
마운트
mount -a && mount
glusterfs 설치
yum install glusterfs-server -y
centos8에서 발생 에러
dnf install glusterfs-server
마지막 메타 데이터 만료 확인 : 0:00:32 전에 2020년 03월 26일 (목) 오전 02시 23분 37초.
오류:
문제: cannot install the best candidate for the job
- nothing provides python3-pyxattr needed by glusterfs-server-7.4-1.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
[root@intradbbackup01 home]# dnf install python3-pyxattr
마지막 메타 데이터 만료 확인 : 0:00:47 전에 2020년 03월 26일 (목) 오전 02시 23분 37초.
인수와 일치하는 항목 없음 : python3-pyxattr
오류: 경기를 찾을 수 없습니다.: python3-pyxattr
dnf --enablerepo=PowerTools install python3-pyxattr
glusterfs 실행
systemctl enable glusterd
systemctl start glusterd
systemctl status glusterd
configure trusted pool
glusterfs1)
gluster peer probe glusterfs2
glusterfs2)
gluster peer probe glusterfs1
: success 가 뜨면 성공
: 아이피가 바뀌면 다시 peer probe 해줘야 함
glusterfs 에서 사용할 볼륨 (디렉토리) 생성
mkdir /bricks/brick1/gv0
replication 으로 설정
[root@glusterfs2 ~]# gluster volume create gv0 replica 2 transport tcp glusterfs1:/bricks/brick1/gv0 glusterfs2:/bricks/brick1/gv0
Replica 2 volumes are prone to split-brain. Use Arbiter or Replica 3 to avoid this. See: http://docs.gluster.org/en/latest/Administrator%20Guide/Split%20brain%20and%20ways%20to%20deal%20with%20it/.
Do you still want to continue?
(y/n) y (입력)
volume create: gv0: success: please start the volume to access data
[root@glusterfs2 ~]# gluster volume start gv0
volume start: gv0: success
- replica 2 = 2개의 복제본을 가짐 (count 개수)
distribute rplication
gluster volume create gv1 replica 2 transport tcp glusterfs1:/bricks/brick1/gv0 glusterfs2:/bricks/brick1/gv0 glusterfs3:/bricks/brick1/gv0 glusterfs4:/bricks/brick1/gv0
볼륨 정보 보기
# gluster volume info
Volume Name: gv0
Type: Replicate
Volume ID: 85fbe5b7-ecd7-447e-a556-d208b15f761c
Status: Started
Snapshot Count: 0
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: glusterfs1:/bricks/brick1/gv0
Brick2: glusterfs2:/bricks/brick1/gv0
Options Reconfigured:
transport.address-family: inet
nfs.disable: on
performance.client-io-threads: off
client mount 하기 (glusterfs 를 이용할 클라이언트)
# 패키지 설치
yum install glusterfs glusterfs-fuse attr -y
# 마운트
mount -t glusterfs glusterfs1:/gv0 /home/gluster1
# fstab에 등록 (옵션)
glusterfs1:/gv0 /var/www/html glusterfs defaults 0 0
피어 상태 확인
# gluster peer status
Number of Peers: 8
Hostname: GFS-72
Uuid: 4ac1b90b-a217-4609-93fd-8397afb01296
State: Peer in Cluster (Connected)
Hostname: GFS-73
Uuid: e47f82d8-0f87-4640-b36d-c1066baea1f1
State: Peer in Cluster (Connected)
Hostname: GFS-74
Uuid: 6d531cff-4b3c-4d98-aafa-3d96598eac0c
State: Peer in Cluster (Connected)
Hostname: GFS-75
Uuid: 65b831e2-d574-436c-9a60-13162cf059e3
State: Peer in Cluster (Connected)
Hostname: GFS-76
Uuid: f3f202c8-a643-47a9-857e-0b45dcfc9403
State: Peer in Cluster (Connected)
Hostname: GFS-77
Uuid: ff751115-45fd-4789-85a5-2461b002bc66
State: Peer in Cluster (Connected)
Hostname: GFS-78
Uuid: 1bd3e4e4-651e-4bab-85a9-fe7616b7805d
State: Peer in Cluster (Connected)
Hostname: GFS-79
Uuid: ecfde313-a9b8-4e29-a2d2-519d8b7c9028
State: Peer in Cluster (Connected)
자신을 제외한 PEER 가 Connected 상태로 표시되면 정상임
gluster1 ,2 중 유독 gluster1 노드만 부하 발생
top - 10:27:21 up 4 min, 1 user, load average: 2.00, 0.81, 0.30
Tasks: 94 total, 1 running, 93 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.3 us, 3.1 sy, 0.0 ni, 0.0 id, 93.8 wa, 0.0 hi, 2.8 si, 0.0 st
KiB Mem : 1015476 total, 64088 free, 64228 used, 887160 buff/cache
KiB Swap: 839676 total, 839676 free, 0 used. 782968 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
959 root 20 0 921472 18992 3336 S 4.7 1.9 0:25.00 glusterfsd
3 root 20 0 0 0 0 S 1.7 0.0 0:05.97 ksoftirqd/0
29 root 20 0 0 0 0 S 0.3 0.0 0:01.13 kswapd0
91 root 20 0 0 0 0 S 0.3 0.0 0:00.52 kworker/0:3
278 root 20 0 0 0 0 D 0.3 0.0 0:02.74 kworker/u2:3
원래 그런거 일수도 있겠다
firewalld (방화벽 포트 설정)
firewall-cmd --permanent --zone public --add-port 24007/tcp
firewall-cmd --permanent --zone public --add-port 49152/tcp
service firewalld reload
방화벽 설정 (서비스 이름으로 설정)
firewall-cmd --permanent --zone=public --add-service=glusterfs
firewall-cmd --reload
원문 참고
https://wiki.centos.org/SpecialInterestGroup/Storage/gluster-Quickstart
'Filesystem' 카테고리의 다른 글
cifs mount glusterfs (0) | 2018.08.28 |
---|---|
nfs mount glusterfs (0) | 2018.08.27 |
RAID (레이드) (0) | 2018.08.21 |
map reduce (0) | 2018.08.21 |
XFS (0) | 2018.08.21 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- SSL
- HAProxy
- mariadb
- L2TP
- php
- IPSEC
- Apache
- OpenVPN
- kvm
- glusterfs
- pptp
- MySQL
- cURL
- centOS7
- centos8
- WAF
- mod_security
- 인증서
- iptables
- ntp
- gitlab
- yum
- ssh
- galera
- GeoIP
- virtualbox
- 베이어다이나믹
- NGINX
- 리눅스
- softether
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함