Glusterfs 를 이용한 스토리지 이중화 설정

Gluster란?

GlusterFS는 확장성이 가능한 NAS 파일 시스템이다. 다수의 스토리지를 이더넷 또는 인피니밴드를 통하여 하나의 커다란 병렬 네트워크 파일 시스템으로 통합한다. 클라우드 컴퓨팅 및 스트리밍 미디어 서비스 그리고 콘텐츠 전송 네트워크와 같은 서비스등에 사용된다

 

진행 방향
본문에선, 동일한 버전 및 OS환경에서 replica모드로 설정을 진행해볼 예정이며,
더불어, 서로다른 gluster버전끼리 묶이는지 테스트도 해보려고 합니다.

 

구성 환경

■ Client 
OS : Oracle Linux 8.7
Gluster Ver : 6.0 

 Server 1
OS : CentOS 7.9
Gluster Ver :  5.13

 Server 2
OS : CentOS 7.9
Gluster Ver :  5.13

 Server 3 (서로 다른버전끼리 묶이는지 테스트하기 위한 용도의 서버)
OS : Oracle Linux 9.1
Gluster Ver :  9.6

 

설치
CentOS 7 버전은 패키지로 설치할 예정이며, 그외 OL 9 버전은 소스설치로 진행합니다.

 

클라이언트 설치
패키지 설치로 gluster 를 설치합니다.
gluster 스토리지를 마운트하기 위해, 필요한 패키지를 설치 합니다.
[root@client ~]# dnf install glusterfs​

gluserfs-server 설치
OS: Cent7 환경에 gluserfs-server 를 설치합니다.
설치는 패키지에 등록된 버전 5.13으로 진행합니다.

5.13설치를 위해 repo를 등록합니다.

repo파일 생성
vi /etc/yum.repos.d/glusterfs.repo
#아래 내용 추가
[glusterfs]
name=glusterfs-5.13 
baseurl=http://mirror.centos.org/centos/$releasever/storage/$basearch/gluster-5/ 
gpgcheck=0​

##glusterfs-server 설치 진행
yum install glusterfs-server

==============================================================================================================================================================================================================
 Package                                                     Arch                                      Version                                             Repository                                    Size
==============================================================================================================================================================================================================
Installing:
 glusterfs-server                                            x86_64                                    5.13-1.el7                                          glusterfs                                    1.4 M
Installing for dependencies:
 attr                                                        x86_64                                    2.4.46-13.el7                                       base                                          66 k
 glusterfs                                                   x86_64                                    5.13-1.el7                                          glusterfs                                    669 k
 glusterfs-api                                               x86_64                                    5.13-1.el7                                          glusterfs                                    108 k
 glusterfs-cli                                               x86_64                                    5.13-1.el7                                          glusterfs                                    203 k
 glusterfs-client-xlators                                    x86_64                                    5.13-1.el7                                          glusterfs                                    991 k
 glusterfs-fuse                                              x86_64                                    5.13-1.el7                                          glusterfs                                    148 k
 glusterfs-libs                                              x86_64                                    5.13-1.el7                                          glusterfs                                    416 k
 libtirpc                                                    x86_64                                    0.2.4-0.16.el7                                      base                                          89 k
 psmisc                                                      x86_64                                    22.20-17.el7                                        base                                         141 k
 rpcbind                                                     x86_64                                    0.2.0-49.el7                                        base                                          60 k
 userspace-rcu                                               x86_64                                    0.10.0-3.el7                                        glusterfs                                     93 k

Transaction Summary
==============================================================================================================================================================================================================
Install  1 Package (+11 Dependent packages)

Total download size: 4.3 M
Installed size: 16 M
Is this ok [y/d/N]: y

설치가 완료되면, glusterd 데몬을 실행합니다.

[root@gluster_server1 ~]# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system server
   Loaded: loaded (/usr/lib/systemd/system/glusterd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
[root@gluster_server1 ~]# systemctl start glusterd
[root@gluster_server1 ~]# systemctl status glusterd
● glusterd.service - GlusterFS, a clustered file-system server
   Loaded: loaded (/usr/lib/systemd/system/glusterd.service; disabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-02-27 00:37:59 EST; 1s ago
  Process: 1554 ExecStart=/usr/sbin/glusterd -p /var/run/glusterd.pid --log-level $LOG_LEVEL $GLUSTERD_OPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 1555 (glusterd)
   CGroup: /system.slice/glusterd.service
           └─1555 /usr/sbin/glusterd -p /var/run/glusterd.pid --log-level INFO

Feb 27 00:37:59 gluster_server1 systemd[1]: Starting GlusterFS, a clustered file-system server...
Feb 27 00:37:59 gluster_server1 systemd[1]: Started GlusterFS, a clustered file-system server.
[root@gluster_server1 ~]#​


똑같은 환경으로 gluster-server 를 하나 더 생성합니다.

다음은 Oralce linux 9 버전에서 glusterfs-server 9 버전 설치를 진행합니다.
기본 패키지로 설치가 되지 않으므로, 소스 컴파일을 통해 설치 진행합니다.

https://download.gluster.org/pub/gluster/glusterfs/9/LATEST/

소스파일 주소 https://download.gluster.org/pub/gluster/glusterfs/9/LATEST/glusterfs-9.6.tar.gz

build,complie 설치 가이드 참고 링크 : https://docs.gluster.org/en/latest/Developer-guide/Building-GlusterFS/

압축 해제 후 해당 경로안에 있는 autogen.sh 를 실행합니다.

sh autogen.sh
실행하게 되면, 필요 패키지들이 나열되고, 해당 패키지를 설치해준뒤 다시 실행하시면 됩니다.
소스 컴파일 설치시, 몇몇 패키지들은 dnf명령어로 바로 설치가 가능하나 일부 패키지는 직접 rpm파일을 저장 및 설치를 해야 합니다.
The following build tools are missing:

  * aclocal
  * autoconf
  * autoheader
  * automake
  * libtoolize/glibtoolize

Please install them and try again.​

 

기본 패키지 설치 목록
다음 패키지들은 dnf로 바로 설치가 가능합니다.

dnf install autoconf  libtool automake rpcgen flex bison openssl-devel libuuid-devel libacl-devel zlib-devel libxml2-devel liburing-devel -y

이외에 rpm설치가 필요한 패키지 리스트
libtirpc-devel
userspace-rcu-devel
https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/x86_64/getPackage/libtirpc-devel-1.3.2-1.0.1.el9.x86_64.rpm

https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/x86_64/getPackage/userspace-rcu-devel-0.12.1-6.el9.x86_64.rpm

dnf 를 이용하여 바로 설치해줍니다.

dnf install https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/x86_64/getPackage/libtirpc-devel-1.3.2-1.0.1.el9.x86_64.rpm
dnf install https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/x86_64/getPackage/userspace-rcu-devel-0.12.1-6.el9.x86_64.rpm

이제 gluster소스 파일 해제한 경로에서 , configure를 진행합니다.

[root@glusterserver3 glusterfs-9.6]# pwd
/root/gluster/glusterfs-9.6
[root@glusterserver3 glusterfs-9.6]# ls
aclocal.m4      build-aux   config.guess  config.status  COPYING-GPLV2   extras               glusterfs.spec     libgfchangelog.pc     ltmain.sh    NEWS          site.h       tests
api             ChangeLog   config.h      config.sub     COPYING-LGPLV3  geo-replication      glusterfs.spec.in  libgfchangelog.pc.in  Makefile     py-compile    site.h.in    THANKS
AUTHORS         cli         config.h.in   configure      depcomp         glusterfs-api.pc     heal               libglusterd           Makefile.am  README.md     stamp-h1     tools
autogen.sh      COMMITMENT  config.h.in~  configure.ac   doc             glusterfs-api.pc.in  INSTALL            libglusterfs          Makefile.in  rpc           stamp-h2     VERSION
autom4te.cache  compile     config.log    contrib        events          glusterfsd           install-sh         libtool               missing      run-tests.sh  test-driver  xlators
[root@glusterserver3 glusterfs-9.6]#
[root@glusterserver3 glusterfs-9.6]# ./configure --prefix=/opt/glusterfs
#완료가 되면, 다음과 같은 내용을 확인할 수 있습니다.

GlusterFS configure summary
===========================
FUSE client          : yes
epoll IO multiplex   : yes
fusermount           : yes
readline             : no
georeplication       : yes
Linux-AIO            : no
Linux-io_uring       : yes
Enable Debug         : no
Run with Valgrind    : no
Sanitizer enabled    : none
Use syslog           : yes
XML output           : yes
Unit Tests           : no
Track priv ports     : yes
POSIX ACLs           : yes
SELinux features     : yes
firewalld-config     : no
Events               : yes
EC dynamic support   : x64 sse avx
Use memory pools     : yes
Nanosecond m/atimes  : yes
Server components    : yes
Legacy gNFS server   : no
IPV6 default         : no
Use TIRPC            : yes
With Python          : 3.9
Cloudsync            : yes
Metadata dispersal   : no
Link with TCMALLOC   : no
Enable Brick Mux     : no
Building with LTO    : yes

[root@glusterserver3 glusterfs-9.6]#

 

이제 make && make install을 통해, 설치를 진행합니다.

 

 

.