RedHat

RedHat Ceph Storage 7 설치

황동리 2024. 9. 3. 16:51
반응형

Ceph 설치 과정

저는 vSphere 환경에서 가상머신 4개를 생성하여 진행하였습니다.

각 노드들 IP 정보 입니다.

bootstrap ceph01 ceph02 ceph03
10.10.91.51 10.10.91.52 10.10.91.53 10.10.91.54

 

모든 노드들에서 아래 명령어 실행

 

# subscription-manager register
=> ID, PW 입력

# subscription-manager refresh

# subscription-manager list --available --matches 'Red Hat Ceph Storage'
=> Subscription Name: Red Hat Ceph Storage Add-on for Red Hat OpenStack Platform, Premium (Up to 512TB on a maximum of 25 Physical Nodes)
위 Subscription Name에 해당하는 Pool ID를 복사

# subscription-manager attach --pool=<위에서 복사한 POOL_ID>

# subscription-manager repos --disable=*
# subscription-manager repos --enable=rhel-9-for-x86_64-baseos-rpms
# subscription-manager repos --enable=rhel-9-for-x86_64-appstream-rpms
# dnf -y update

# subscription-manager repos --enable=rhceph-7-tools-for-rhel-9-x86_64-rpms
# dnf install cephadm-ansible

 

dnf update 시 오류가 나올 경우

# REPOS=$(awk '/^\[/{gsub(/\[|\]/, "", $0); printf("--repo %s ", $0)}' /etc/yum.repos.d/redhat.repo)
# subscription-manager repo-override --add sslverifystatus:0 $REPOS
=> repo에서 ssl인증을 꺼주는 과정 입니다.

 

이제부턴 편의상 bootstrap 노드에서 모두 진행해주도록 하겠습니다.

# cd /usr/share/cephadm-ansible
# mkdir -p inventory/staging inventory/production

---------------------
# vi /usr/share/cephadm-ansible/ansible.cfg
[defaults]
inventory = ./inventory/staging
---------------------

# touch /usr/share/cephadm-ansible/inventory/staging/hosts
# touch /usr/share/cephadm-ansible/inventory/production/hosts

---------------------
# vi /etc/hosts
10.10.91.51 bootstrap
10.10.91.52 ceph01
10.10.91.53 ceph02
10.10.91.54 ceph03
---------------------

---------------------
# vi /usr/share/cephadm-ansible/inventory/staging/hosts
ceph01
ceph02
ceph03

[admin]
bootstrap
---------------------

---------------------
# vi /usr/share/cephadm-ansible/inventory/production/hosts
ceph01
ceph02
ceph03

[admin]
bootstrap
---------------------

# ssh-keygen
# ssh-copy-id root@bootstrap
# ssh-copy-id root@ceph01
# ssh-copy-id root@ceph02
# ssh-copy-id root@ceph03

---------------------
# vi /root/.ssh/config
Host ceph01
	Hostname ceph01
	User root
Host ceph02
	Hostname ceph02
	User root
Host ceph03
	Hostname ceph03
	User root
---------------------

# chmod 600 /root/.ssh/config
# ansible-playbook -vvv -i hosts cephadm-preflight.yml --extra-vars "ceph_origin=rhcs"
# cephadm bootstrap --cluster-network 10.10.91.0/24 --mon-ip 10.10.91.51 --registry-url registry.redhat.io --registry-username smrcadmin --registry-password 'Smrc2024!@'

- 호스트 추가
# ssh-copy-id -f -i /etc/ceph/ceph.pub root@ceph01
# ssh-copy-id -f -i /etc/ceph/ceph.pub root@ceph02
# ssh-copy-id -f -i /etc/ceph/ceph.pub root@ceph03
# scp ceph.client.admin.keyring ceph.conf ceph.pub root@ceph01:/etc/ceph/
# scp ceph.client.admin.keyring ceph.conf ceph.pub root@ceph02:/etc/ceph/
# scp ceph.client.admin.keyring ceph.conf ceph.pub root@ceph03:/etc/ceph/
# ceph orch host add ceph01
# ceph orch host add ceph02
# ceph orch host add ceph03

- OSD 추가
추가 하려면 각 ceph01,02,03 호스트들에게 새로운 하드디스크를 추가를 해주어야 한다.
# ceph orch device ls --refresh 
available 한 디스크가 나오면 추가를 진행
# ceph orch daemon add osd ceph01:/dev/sdb
# ceph orch daemon add osd ceph02:/dev/sdb
# ceph orch daemon add osd ceph03:/dev/sdb

 

참고링크
https://docs.redhat.com/ko/documentation/red_hat_ceph_storage/7/html-single/installation_guide/index

반응형