Ceph Mushandisi

Maitiro ekuisa iyo Ceph Kuchengeta Cluster pane Ubuntu 16.04

Maitiro ekuisa iyo Ceph Kuchengeta Cluster pane Ubuntu 16.04

Ceph yakavhurika sosi yekuchengetera chikuva, inopa kumusoro kuita, kuvimbika, uye scalability. Iyo yemahara yakaparadzirwa yekuchengetera system iyo inopa chinongedzo chechinhu, block, uye faira-chikamu chekuchengetedza uye inogona kushanda isina kana poindi imwechete yekutadza.

Mune ino dzidziso, ini ndinokutungamira iwe kuti uise uye uvake iyo Ceph cluster pane Ubuntu 16.04 server. Boka raCeph rine zvinhu izvi:

  • Ceph OSDs (ceph-osd) - Inobata iyo yekuchengetedza data, kudzokorora data, uye kupora. Boka raCeph rinoda maviri maCeph OSD maseva. Isu tinoshandisa matatu Ubuntu 16.04 maseva mune ino setup.
  • Ceph Monitor (ceph-mon) - Inoongorora iyo masango mamiriro uye inomhanyisa iyo OSD mepu uye CRUSH mepu. Tichashandisa server imwe pano.
  • Ceph Meta Dhata Dhata (ceph-mds) - izvi zvinodiwa kana iwe uchida kushandisa Ceph seFayile Sisitimu.

Zvinotarisirwa

  • 6 server node neUbuntu 16.04 server yakaiswa
  • Rombo remidzi pane ese maodhi

Ini ndinoshandisa inotevera hostname / IP setup:

hostname IP kero
ceph-admin 10.0.15.10
mon1 10.0.15.11
osd1 10.0.15.21
osd2 10.0.15.22
osd3 10.0.15.23
mutengi 10.0.15.15

Nhanho 1 - Gadzira ese maNode

Mune ino nhanho, isu tichagadzirisa ese matanhatu ma node ekuvagadzirira iwo kuiswa kweCeph Cluster software. Saka iwe unofanirwa kutevera nekumhanyisa iyo mirairo pazasi pane ese maodhi. Uye ita shuwa kuti ssh-server yakaiswa pane ese maodhi.

Gadzira iyo Ceph Mushandisi

Gadzira mushandisi mutsva anonzi 'cephuser'pane ese maodhi.

mushandisi -m -s / bin / bash cephuser
passwd cephuser

Mushure mekugadzira mushandisi mutsva, tinofanirwa kugadzirisa cephuser yezve password isina rondedzero. Izvi zvinoreva kuti 'cephuser' anogona kumhanya uye kuwana ropafadzo dzerudo asina kutanga atanga password.

Mhanya iyo mirairo pazasi kuti uwane izvozvo.

echo "cephuser ZVESE = (mudzi) NOPASSWD: ZVESE" | sudo tee /etc/sudoers.d/cephuser
chmod 0440 /etc/sudoers.d/cephuser
sed -i s '/ Defaults zvinoda / # Zvisaririra zvinoda' / g / etc / sudoers

Isa uye Gadzira NTP

Isa NTP kuyananisa zuva uye nguva pane ese maodhi. Mhanya iyo ntpdate yekuraira yekumisikidza zuva uye nguva kuburikidza neNTP. Isu tinoshandisa iyo US dziva NTP maseva. Wobva watanga uye kugonesa NTP server kumhanya panguva yebhoti.

sudo apt-tora kuisa -y ntp ntpdate ntp-doc
ntpdate 0.us.pool.ntp.org
hwclock –systohc
systemctl inogonesa ntp
systemctl kutanga ntp

Isa Vhura-vm-maturusi

Kana iwe uchimhanyisa ese maodhi mukati meVMware, iwe unofanirwa kuisa ino virtualization utility.

sudo apt-tora kuisa -y kuvhura-vm-maturusi

Isa Python uye wakaparadzaniswa

Mune ino dzidziso, isu tinoda python mapakeji ekuvaka iyo ceph-cluster. Isa python uye python-pip.

sudo apt-tora kuisa -y python python-pipu yakakamurwa

Gadzira iyo Hosi Faira

Rongedza iyo yefaira faira pane ese maodhi ane vim mupepeti.

vim / etc / mauto

Namatira kumisikidzwa pazasi:

10.0.15.10 ceph-admin 10.0.15.11 mon1 10.0.15.21 ceph-osd1 10.0.15.22 ceph-osd2 10.0.15.23 ceph-osd3 10.0.15.15 ceph-mutengi

Sevha iyo yefaira faira uye buda iyo vim mupepeti.

Iye zvino unogona kuyedza ping pakati pemaseva hostnames kuyedza kubatana kwenetiweki.

ping -c 5 mon1

Ceph cluster Kuisirwa paUbuntu 16.04

Nhanho 2 - Gadzira iyo SSH Server

Mune ino nhanho, isu tichagadzirisa iyo ceph-admin node. Iyo admin node inoshandiswa kugadzirisa iyo yekutarisa node uye osd node. Pinda kune ceph-admin node uye pinda iyo 'cephuser'.

ssh [email protected]
su - cephuser

Iyo admin node inoshandiswa pakuisa uye kugadzirisa ese masumbu node, saka mushandisi pane ceph-admin node anofanirwa kuve nerombo rekubatanidza kune ese maodhi asina password. Isu tinofanirwa kumisikidza password-shoma SSH yekuwana ye 'cephuser' pane iyo 'ceph-admin' node.

Gadzira iyo ssh kiyi ye 'cephuser'.

ssh-keygen

Siya passphrase haina chinhu / isina chinhu.

Tevere, gadzira iyo yekumisikidza faira yeiyo ssh gadziriso.

vim ~ / .ssh / gadziriso

Namatira kumisikidzwa pazasi:

Host ceph-admin Hostname ceph-admin Mushandisi cephuser Host mon1 Hostname mon1 Mushandisi cephuser Host ceph-osd1 Hostname ceph-osd1 Mushandisi cephuser Host ceph-osd2 Hostname ceph-osd2 Mushandisi cephuser Host ceph-osd3 Hostname ceph-osd3 Mushandisi cephuser Host ceph-mutengi Hostname ceph-mutengi Mushandisi cephuser

Sevha iyo faira uye buda vim.

Ceph-admin kumisikidza

Chinja mvumo yeiyo faira yekumisikidza kuva 644

chmod 644 ~ / .ssh / config

Zvino wedzera kiyi kumatanho ese neiyo ssh-kopi-id yekuraira.

ssh-keyscan ceph-osd1 ceph-osd2 ceph-osd3 ceph-mutengi mon1 >> ~ / .ssh / anozivikanwa_hosts
ssh-kopi-id ceph-osd1
ssh-kopi-id ceph-osd2
ssh-kopi-id ceph-osd3
ssh-kopi-id mon1

Nyora pasiwedhi yako yepephuser paunokumbirwa.

Ceph-admin shandisa ssh kiyi kune ese masango node

Iye zvino edza kuwana iyo osd1 server kubva kune ceph-admin node kuyedza kana password-shoma yekupinda inoshanda.

ssh ceph-osd1

SSH Pashoma pasiwedhi kubva ceph-admin kune ese masosi masumbu

Nhanho 3 - Gadzira iyo Ubuntu Firewall

Nezvikonzero zvekuchengetedza, isu tinofanirwa kuvhura iyo firewall pane maseva. Sezvineiwo isu tinoshandisa Ufw (Uncomplicated Firewall), iyo default Ubuntu firewall, kuchengetedza iyo system. Mune ino nhanho, isu tichagonesa ufw pane ese masosi, tobva tavhura madoko anodiwa na ceph-admin, ceph-mon na ceph-osd.

Pinda kune iyo ceph-admin node uye isa iyo ufw mapakeji.

ssh [email protected]
sudo apt-tora kuisa -y ufw

Vhura chiteshi 80, 2003 uye 4505-4506, wozotangazve firewalld.

sudo ufw chirega 22 / tcp
sudo ufw chirega 80 / tcp
sudo ufw chirega 2003 / tcp
sudo ufw bvumira 4505: 4506 / tcp

Kutanga uye gonesa ufw kutanga panguva yebhoti.

sudo ufw shandisa

UFW Firewall neCeph sevhisi

Kubva pane ceph-admin node, pinda kune yekutarisa node 'mon1' uye gadza ufw.

ssh mon1
sudo apt-tora kuisa -y ufw

Vhura zviteshi zveiyo ceph yekutarisa node uye tanga ufw.

sudo ufw chirega 22 / tcp
sudo ufw chirega 6789 / tcp
sudo ufw shandisa

Chekupedzisira, vhura aya madoko pane yega osd node: ceph-osd1, ceph-osd2 uye ceph-osd3 - chiteshi 6800-7300.

Pinda kune yega yega ceph-osd node kubva kune ceph-admin, uye gadza ufw.

ssh ceph-osd1
sudo apt-tora kuisa -y ufw

Vhura madoko pane osd node uye dzosera zvakare firewalld.

sudo ufw chirega 22 / tcp
sudo ufw bvumira 6800: 7300 / tcp
sudo ufw shandisa

Iyo ufw firewall yekugadzirisa yapera.

Nhanho 4 - Gadzira iyo Ceph OSD Node

Mune ino dzidziso, isu tine matatu OSD node, imwe yeaya maodhi ane maviri akaomarara disk zvikamu.

  1. / dev / sda yekuparadzanisa midzi
  2. / dev / sdb isina chinhu chikamu - 20GB

Tichashandisa / dev / sdb yeiyo ceph disk. Kubva pane ceph-admin node, pinda kune ese maODS node uye fomati iyo / dev / sdb kugoverana ne XFS faira system.

ssh ceph-osd1
ssh ceph-osd2
ssh ceph-osd3

Tarisa chikamu chekuparadzanisa ne fdisk murairo.

sudo fdisk -l / dev / sdb

Fomati iyo / dev / sdb partition neiyo XFS fileystem uye ine GPT yekuparadzanisa tafura uchishandisa iro rakakamurwa rairo.

sudo akapatsanurwa -s / dev / sdb mklabel gpt mkpart yekutanga xfs 0% 100%

Tevere, fomati iyo chikamu mu XFS fomati neiyo mkfs yekuraira.

sudo mkfs.xfs -f / dev / sdb

Zvino tarisa chidimbu, uye iwe uchaona XFS / dev / sdb chikamu.

sudo fdisk -s / dev / sdb
sudo blkid -o kukosha -s TYPE / dev / sdb

Fomati kupatsanura ceph OSD node

Nhanho 5 - Vaka iyo Ceph Cluster

Mune ino nhanho, isu tichaisa Ceph pane ese maodhi kubva kune ceph-admin. Kuti utange, pinda kune ceph-admin node.

ssh [email protected]
su - cephuser

Isa ceph-deploy pane ceph-admin node

Padanho rekutanga isu tatoisa python uye python-pip ku system. Iye zvino tinofanirwa kuisa iyo Ceph deployment chishandiso 'ceph-deploy'kubva pypi python repository.

Isa ceph-deploy pane ceph-admin node nemutemo wepip.

sudo pombi yekuisa ceph-deploy

Ongorora: Ita shuwa kuti ese maodhi akagadziridzwa.

Mushure mekunge ceph-deploy chishandiso yaiswa, gadzira dhairekitori nyowani yekugadzirisa kweCeph sumbu.

Gadzira Cluster nyowani

Gadzira dhairekitori idzva remasumbu.

mkdir masumbu
cd musumbu /

Tevere, gadzira sumbu idzva ne 'ceph-deploy'raira nekutsanangudza tarisiro node'mon1'.

ceph-deploy nyowani mon1

Iwo wekuraira unogadzira iyo Ceph masumbu ekugadziriswa faira 'ceph.conf' mune sumbu dhairekitori.

Gadzira nyowani ceph sumbu kumisikidzwa

Rongedza iyo ceph.conf faira ine vim.

vim ceph.conf

Pasi peiyo [yepasi rose] block, namatidza kumisikidza pazasi.

# Yako network kero yeruzhinji network = 10.0.15.0/24 osd dziva default size = 2

Sevha iyo faira uye buda mupepeti.

Isa Ceph pane ese maNode

Iye zvino isa Ceph pane ese maodhi kubva kune ceph-admin node nemirairo imwechete.

ceph-deploy gadza ceph-admin ceph-osd1 ceph-osd2 ceph-osd3 mon1

Iwo wekuraira unozongoisa yega Ceph pane ese maodhi: mon1, osd1-3 uye ceph-admin - Iyo yekumisikidza inotora imwe nguva.

Iye zvino shandisa iyo node yekutarisa pane iyo mon1 node.

ceph-deploy mon gadzira-kutanga

Iwo wekuraira unogadzira yekutarisa kiyi, tarisa kiyi neiyi ceph yekuraira.

ceph-deploy unganidza mon1

Shandisa kiyi ceph

Kuwedzera OSDS kuCluster

Mushure mekunge Ceph yaiswa pane ese maodhi, ikozvino tinogona kuwedzera madhimoni eOSD kusumbu. OSD Daemons ichagadzira iyo data uye chikamu chemagazini pane diski / dev / sdb.

Tarisa iripo disk / dev / sdb pane ese osd node.

ceph-shandisa disk runyorwa ceph-osd1 ceph-osd2 ceph-osd3

disk runyorwa rweasd node

Iwe uchaona / dev / sdb neiyo XFS fomati yatakagadzira kare.

Tevere, bvisa matafura ekuparadzanisa pane ese maodhi pamwe neye zap sarudzo.

ceph-deploy dhisiki zap ceph-osd1: / dev / sdb ceph-osd2: / dev / sdb ceph-osd3: / dev / sdb

Iwo wekuraira uchabvisa rese data pa / dev / sdb pane iyo Ceph OSD node.

Iye zvino gadzirira ese maodhi eOSD uye uve nechokwadi chekuti hapana zvikanganiso mumhedzisiro.

ceph-deploy osd gadzirira ceph-osd1: / dev / sdb ceph-osd2: / dev / sdb ceph-osd3: / dev / sdb

Paunoona iyo ceph-osd1-3 yakagadzirira OSD kushandiswa mune mhedzisiro, ipapo rairo rakabudirira.

Gadzirira iyo ceph-osd node

Shandisai OSD'S nemurairo uri pasi apa:

ceph-deploy osd shandisa ceph-osd1: / dev / sdb ceph-osd2: / dev / sdb ceph-osd3: / dev / sdb

Iye zvino unogona kutarisa iyo sdb diski pane OSDS node zvakare.

ceph-shandisa disk runyorwa ceph-osd1 ceph-osd2 ceph-osd3

Ceph osds yakaitwa

Mhedzisiro yacho ndeyekuti / dev / sdb ine zvikamu zviviri izvozvi:

  1. / dev / sdb1 - Ceph Dhata
  2. / dev / sdb2 - Ceph Chinyorwa

Kana iwe unozvitarisa zvakananga pane iyo OSD node.

ssh ceph-osd1
sudo fdisk -l / dev / sdb

Ceph OSD node dzakagadzirwa

Tevere, tumira manejimendi-kiyi kune ese anoenderana node.

ceph-shandisa admin ceph-admin mon1 ceph-osd1 ceph-osd2 ceph-osd3

Chinja mvumo yeiyo kiyi faira nekumhanyisa iwo murairo pazasi pane ese maodhi.

sudo chmod 644 /etc/ceph/ceph.client.admin.keyring

Iyo Ceph Cluster paUbuntu 16.04 yakagadzirwa.

Nhanho 6 - Kuedza Ceph

Mune nhanho 4, isu takaisa uye takagadzira nyowani yeCeph cluster, uye takawedzera maODS OS kune iyo sumbu. Iye zvino isu tinofanirwa kuyedza sumbu kuti tione kuti rinoshanda sekufunga.

Kubva pane ceph-admin node, pinda muCeph yekutarisa server 'mon1'.

ssh mon1

Mhanya iwo wekuraira pazasi kuti utarise masumbu hutano

sudo ceph hutano

Zvino tarisa mamiriro echikwata.

sudo ceph -s

Unogona kuona mhedzisiro pazasi:

Ceph Cluster Mamiriro

Ita shuwa kuti hutano hwaCeph huripo OK uye kune tarisiro node 'mon1'ine IP kero'10.0.15.11'. Pane 3 OSD maseva uye ese ari up uye kumhanya, uye panofanirwa kuve nenzvimbo yediski iripo ye 45GB - 3x15GB Ceph Data OSD chikamu.

Isu tinovaka nyowani Ceph Cluster paUbuntu 16.04 zvinobudirira.

Reference

 

mabviro