2022. 2. 26. 18:14ใ๐ฏ OpenSource/Ceph
ceph์ ๊ธฐ๋ณธ ๋์ ์๋ฆฌ๋ฅผ ์ง์ ํ์ ํด ๋ณด๊ธฐ ์ํด ceph-deploy๋ก ๋ฐฐํฌ๋ฅผ ํด๋ณด๊ณ ์ ํ๋ค.
์ค์น ๋ฒ์ : nautilus
๊ณต์ ๊ฐ์ด๋ : https://docs.ceph.com/en/nautilus/start/
ceph ์ฌ์ฉ ์ฉ๋
- openstack cinder, glance์ backend storage๋ก ์ฌ์ฉ
-> RBD ์ค์น - Object Storage ์๋น์ค ๊ตฌ์ถ
-> RADOSGW ์ค์น
๊ตฌ์ถ ํ๊ฒฝ
OS : Ubuntu 20.04
deploy ์๋ฒ 1๋
ceph osd ๋
ธ๋ 3๋
-> ceph ์๋ osd disk ๊ฐ 100GB (vdb, vdc, vdd)
Host Name | Service Network | Internal Network | External Network | Tenant Network | Storage Network |
---|---|---|---|---|---|
wglee-deploy | 20.20.0.10 | 183.10.0.10 | 20.20.10.10 | 20.20.20.10 | |
wglee-ceph-001 | 20.20.0.50 | 183.10.0.50 | 20.20.10.50 | 20.20.20.50 | |
wglee-ceph-002 | 20.20.0.51 | 183.10.0.51 | 20.20.10.51 | 20.20.20.51 | |
wglee-ceph-003 | 20.20.0.52 | 183.10.0.52 | 20.20.10.52 | 20.20.20.52 |
๋ฐฐํฌ ์ ์ฌ์ ์์
Ubuntu OS ๊ธฐ์ค์ผ๋ก ์ค์น๋ฅผ ์งํํ๋ค.
ceph-deploy ํจํค์ง ์ค์น
ceph-deploy ๋ฐฉ์์ deploy ๋
ธ๋์์ admin ๊ถํ์ ๊ฐ์ง ๊ณ์ ์ ์ด์ฉํด ๊ฐ ceph ๋
ธ๋๋ค๋ก ceph์ ๋ฐฐํฌํ๋ค.
deploy ์๋ฒ์ ceph-deploy ํจํค์ง๋ฅผ ์ค์นํ๋๋ก ํ๋ค.
๋ํ, deploy ๋ฐ ๊ฐ ceph ๋
ธ๋๋ค์ ์๊ฐ ๋๊ธฐํ๊ฐ ๋์ด ์์ด์ผ ํ๋ค.
๊ฐ์์๋ฒ ์์ฑ ํ์ chrony ๋ก ๋ง์ถฐ๋ ์ํ์ด๊ธฐ ๋๋ฌธ์ ํด๋น ๊ณผ์ ์ ์ฌ๊ธฐ์ ์๋ตํ์๋ค.
root@deploy:/home/ceph-deploy# wget -q -O- 'https://download.ceph.com/keys/release.asc' | sudo apt-key add -
OK
# nautilus ๋ฒ์ ์ง์ ํ์ฌ repo ์ถ๊ฐ
root@deploy:/home/ceph-deploy# echo deb https://download.ceph.com/debian-nautilus/ $(lsb_release -sc) main | sudo tee /etc/apt/sour
ces.list.d/ceph.list
deb https://download.ceph.com/debian-nautilus/ focal main
ceph-deploy ํจํค์ง ์ค์น
root@deploy:/home/ceph-deploy# sudo apt update
Hit:1 http://ppa.launchpad.net/ansible/ansible/ubuntu trusty InRelease
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:5 https://download.ceph.com/debian-nautilus focal InRelease [8391 B]
Hit:6 http://ppa.launchpad.net/ansible/ansible/ubuntu focal InRelease
Get:7 https://download.ceph.com/debian-nautilus focal/main amd64 Packages [541 B]
Get:8 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1581 kB]
Fetched 1926 kB in 3s (575 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
49 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@deploy:/home/ceph-deploy# apt install ceph-deploy
0 upgraded, 1 newly installed, 0 to remove and 49 not upgraded.
๋ฐฐํฌ์ ์ฌ์ฉํ ๊ณ์ ์์ฑ
deploy ์๋ฒ์์ ๊ฐ ceph ์๋ฒ์ ํจ์ค์๋ ์์ด admin ๊ถํ์ผ๋ก ์ ์ํ ๊ณ์ ์ ์ธํ
ํ๋ค.
๊ฐ ๋
ธ๋์์ cephuser ๊ณ์ ์ ์์ฑํ๊ณ sudo ๊ถํ์ ๋ถ์ฌํ๋ค.
root@wglee-ceph-001:~# useradd -d /home/cephuser -m cephuser
root@wglee-ceph-001:~# passwd cephuser
root@wglee-ceph-001:~# echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser
cephuser ALL = (root) NOPASSWD:ALL
root@wglee-ceph-001:~# sudo chmod 0440 /etc/sudoers.d/cephuser
root@wglee-ceph-002:~# useradd -d /home/cephuser -m cephuser
root@wglee-ceph-002:~# passwd cephuser
root@wglee-ceph-002:~# echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser
cephuser ALL = (root) NOPASSWD:ALL
root@wglee-ceph-002:~# sudo chmod 0440 /etc/sudoers.d/cephuser
root@wglee-ceph-003:~# useradd -d /home/cephuser -m cephuser
root@wglee-ceph-003:~# passwd cephuser
root@wglee-ceph-003:~# echo "cephuser ALL = (root) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/cephuser
cephuser ALL = (root) NOPASSWD:ALL
root@wglee-ceph-003:~# sudo chmod 0440 /etc/sudoers.d/cephuser
์ด๋ ๊ฒ ์์ฑํ cephuser๊ฐ ssh keypair ๋ฐฉ์์ผ๋ก ceph ์๋ฒ์ ์ ์ํ ์ ์๋๋ก ํ๋ค.
๋๋ ์ด๋ฏธ deploy์ ssh-keygen์ผ๋ก ์์ฑํ ํคํ์ด๊ฐ ์์ด์ ๊ทธ๊ฑธ ์ฌ์ฉํ๋ค.
root@deploy:/etc/ansible# ssh-copy-id cephuser@wglee-ceph-001
Number of key(s) added: 1
root@deploy:/etc/ansible# ssh-copy-id cephuser@wglee-ceph-002
Number of key(s) added: 1
root@deploy:/etc/ansible# ssh-copy-id cephuser@wglee-ceph-003
Number of key(s) added: 1
๋ฐ๋ชฌ ๊ฐ ํต์ ๊ฐ๋ฅํ๋๋ก ๋ฐฉํ๋ฒฝ ์ค์
ceph mon ๋ฐ osd ๋ฐ๋ชฌ์ด ํต์ ํ ํฌํธ ๋ฐฉํ๋ฒฝ์ ์ค์ ํ๋ค.
Ceph monitor ๋ฐ๋ชฌ์ ๊ธฐ๋ณธ์ผ๋ก 6789 ํฌํธ๋ฅผ ์ฌ์ฉํ๊ณ , Ceph osd๋ 6800:7300 ranged์ ํฌํธ๋ฅผ ์ฌ์ฉํ๋ค๊ณ ํ๋ค.
ํต์ ์ด ์ํํ๊ฒ ๋ ์ ์๋๋ก ํ์ํ ํฌํธ์ ๋ํ Inbound ๋ฃฐ์ ํ์ฉํ๋ค.
๋ชจ๋ ceph, ์ฆ wglee-ceph-001~003์์ ๋๊ฐ์ด ์ํํ๋๋ก ํ๋ค.
root@wglee-ceph-001:~# sudo apt install iptables-persistent
root@wglee-ceph-001:~# iptables -A INPUT -i ens7 -p tcp -s 20.20.20.0/24 --dport 6789 -j ACCEPT
root@wglee-ceph-001:~# sudo iptables -A INPUT -i ens7 -p tcp --match multiport -s 20.20.20.0/24 --dports 6800:7300 -j ACCEPT
root@wglee-ceph-001:~# iptables-save > /etc/iptables/rules.v4
root@wglee-ceph-001:~# iptables-restore < /etc/iptables/rules.v4
๋ค์๊ณผ ๊ฐ์ด ์ ์ฉ๋์๋ค.
root@wglee-ceph-001:~# iptables -nvL
Chain INPUT (policy ACCEPT 332 packets, 26857 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT tcp -- ens7 * 20.20.20.0/24 0.0.0.0/0 tcp dpt:6789
0 0 ACCEPT tcp -- ens7 * 20.20.20.0/24 0.0.0.0/0 multiport dports 6800:7300
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 235 packets, 32749 bytes)
pkts bytes target prot opt in out source destination
'๐ฏ OpenSource > Ceph' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[ ceph ] Rados Block Device (RBD) ์ค์นํ๊ธฐ (0) | 2022.05.21 |
---|---|
[ ceph-deploy ] 02. ceph cluster ๋ฐฐํฌํ๊ธฐ (0) | 2022.02.27 |
Ceph ๊ธฐ๋ณธ ๋์ ์๋ฆฌ (0) | 2021.02.21 |