문서의 이전 판입니다!


구축사례 - Ceph RBD with Samba HA (Pacemaker,LVM)

이강우 2018/12/06 13:25

본 문서는 Ceph RBD를 BackStore Storage 로 사용하고 Samba를 통해 CIFS 서비스를 HA로 구성하는 사례를 설명한다.

  • RedHat Enterprise Linux 7.6 with High Availability
  • RedHat Ceph Storage 3.1 (Ceph Community 12.2.5 Luminous)

전체적인 구성도는 아래와 같다.

Ceph RBd with Samba HA (Pacemaker,LVM)

Ceph Storage에서 RBD로 블럭장치를 제공받아 해당 블럭에 LVM파일시스템을 생성하여 그것을 Samba CIFS로 제공하는 구성이다.
이 구성은 간단한 구성이며 NFS같은 다른 서비스에도 동일한 형태로 구성이 가능하다.

단지 차이점이 있다면 고가용성(High Availability)제공 방법을 어떤것으로 구성하느냐 하는점에 차이가 있을수 있다. 본 사례에서는 RedHat High Availability(pacemaker)를 사용하여 구성하지만 상황에 따라 CTDB, Ganesha, HAProxy등 다른 솔루션을 사용하여 구축하는 방법도 가능할것으로 본다.

일단 Ceph Storage 자체는 이미 구성되어있다고 가정한다. 이 부분은 별도로 Ceph 관련 문서를 참조하기 바란다.
구성되어있는 Ceph Storage에서 Samba CIFS 서비스 제공을 위한 공유 스토리지 용도의 블럭장치 이미지를 생성한다.

[root@ceph-mon1 ~]# ceph osd pool create rbd 64 64
pool 'cifspool' created

[root@ceph-mon1 ~]# ceph osd pool application enable rbd rbd
enabled application 'rbd' on pool 'rbd'

[root@ceph-mon1 ~]# ceph osd pool ls detail
pool 1 '.rgw.root' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 28 flags hashpspool stripe_width 0 application rgw
pool 2 'default.rgw.control' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 30 flags hashpspool stripe_width 0 application rgw
pool 3 'default.rgw.meta' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 32 flags hashpspool stripe_width 0 application rgw
pool 4 'default.rgw.log' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 8 pgp_num 8 last_change 34 flags hashpspool stripe_width 0 application rgw
pool 5 'rbd' replicated size 3 min_size 2 crush_rule 0 object_hash rjenkins pg_num 64 pgp_num 64 last_change 84 flags hashpspool stripe_width 0 application rbd

위와같이 rbd pool 이 생성되었다. 해당 rbd pool에 10GB짜리 공유 스토리지용 볼륨이미지를 생성한다.

[root@ceph-mon1 ~]# rbd create cifsvol --size 10G
[root@ceph-mon1 ~]# rbd ls -l
NAME      SIZE PARENT FMT PROT LOCK 
cifsvol 10240M          2           

여기까지 Ceph storage 에서의 준비는 끝났다. 스토리지쪽에서 해줘야 할일은 단순히 공유볼륨을 만들어서 제공하는것뿐이다.

Samba 서비스를 제공할 Gateway서버를 구성한다. 고가용성을 위해 서버 2대를 RedHat High Availability 로 구성하도록 한다.

Gateway 서버는 아래 2대로 구성되었다고 가정한다.

  • rhcs1.local.domain
  • rhcs2.local.domain

Pacemaker로 두 서버를 클러스터로 구성해준다.

[root@rhcs1 cib]# pcs cluster auth rhcs1.local.domain rhcs2.local.domain
rhcs2.local.domain: Already authorized
rhcs1.local.domain: Already authorized

[root@rhcs1 cib]# pcs cluster setup --start --name HACL rhcs1.local.domain rhcs2.local.domain
Destroying cluster on nodes: rhcs1.local.domain, rhcs2.local.domain...
rhcs1.local.domain: Stopping Cluster (pacemaker)...
rhcs2.local.domain: Stopping Cluster (pacemaker)...
rhcs1.local.domain: Successfully destroyed cluster
rhcs2.local.domain: Successfully destroyed cluster

Sending 'pacemaker_remote authkey' to 'rhcs1.local.domain', 'rhcs2.local.domain'
rhcs1.local.domain: successful distribution of the file 'pacemaker_remote authkey'
rhcs2.local.domain: successful distribution of the file 'pacemaker_remote authkey'
Sending cluster config files to the nodes...
rhcs1.local.domain: Succeeded
rhcs2.local.domain: Succeeded

Starting cluster on nodes: rhcs1.local.domain, rhcs2.local.domain...
rhcs1.local.domain: Starting Cluster (corosync)...
rhcs2.local.domain: Starting Cluster (corosync)...
rhcs1.local.domain: Starting Cluster (pacemaker)...
rhcs2.local.domain: Starting Cluster (pacemaker)...

Synchronizing pcsd certificates on nodes rhcs1.local.domain, rhcs2.local.domain...
rhcs2.local.domain: Success
rhcs1.local.domain: Success
Restarting pcsd on the nodes in order to reload the certificates...
rhcs2.local.domain: Success
rhcs1.local.domain: Success

[root@rhcs1 cib]# pcs cluster enable --all
rhcs1.local.domain: Cluster Enabled
rhcs2.local.domain: Cluster Enabled

[root@rhcs1 cib]# pcs status
Cluster name: HACL

WARNINGS:
No stonith devices and stonith-enabled is not false

Stack: corosync
Current DC: rhcs2.local.domain (version 1.1.19-8.el7_6.1-c3c624ea3d) - partition with quorum
Last updated: Tue Dec  4 17:51:27 2018
Last change: Tue Dec  4 17:39:03 2018 by hacluster via crmd on rhcs2.local.domain

2 nodes configured
0 resources configured

Online: [ rhcs1.local.domain rhcs2.local.domain ]

No resources


Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

이렇게 하면 일단 두 노드간 클러스터 구성은 완료되었다.

이제 Ceph Storage에서 제공한 볼륨을 공유볼륨으로 구성하도록 한다.

— 계속

  • 구축사례_-_ceph_rbd_with_samba_ha_pacemaker_lvm.1544072698.txt.gz
  • 마지막으로 수정됨: 2018/12/06 05:04
  • 저자 koov