Ceph Quincy : OSDs जोड़ें या हटाएँ2023/08/28 |
मौजूदा क्लस्टर से OSDs को जोड़ने या हटाने का तरीका इस प्रकार है।
| +--------------------+ | +----------------------+ | [dlp.srv.world] |10.0.0.30 | 10.0.0.31| [www.srv.world] | | Ceph Client +-----------+-----------+ RADOSGW | | | | | | +--------------------+ | +----------------------+ +----------------------------+----------------------------+ | | | |10.0.0.51 |10.0.0.52 |10.0.0.53 +-----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [node01.srv.world] | | [node02.srv.world] | | [node03.srv.world] | | Object Storage +----+ Object Storage +----+ Object Storage | | Monitor Daemon | | | | | | Manager Daemon | | | | | +-----------------------+ +-----------------------+ +-----------------------+ |
[1] | उदाहरण के लिए, एडमिन नोड पर OSDs में एक [node04] नोड जोड़ें। नए [node04] नोड पर डिवाइस को ब्लॉक करने के लिए, इस उदाहरण पर [/dev/sdb] का उपयोग करें। |
# सार्वजनिक कुंजी स्थानांतरित करें root@node01:~# ssh-copy-id node04 # आवश्यक पैकेज स्थापित करें root@node01:~# ssh node04 "apt update; apt -y install ceph"
# आवश्यक फ़ाइलें स्थानांतरित करें root@node01:~# scp /etc/ceph/ceph.conf node04:/etc/ceph/ceph.conf root@node01:~# scp /etc/ceph/ceph.client.admin.keyring node04:/etc/ceph root@node01:~# scp /var/lib/ceph/bootstrap-osd/ceph.keyring node04:/var/lib/ceph/bootstrap-osd
# OSD कॉन्फ़िगर करें root@node01:~# ssh node04 \ "chown ceph. /etc/ceph/ceph.* /var/lib/ceph/bootstrap-osd/*; \ parted --script /dev/sdb 'mklabel gpt'; \ parted --script /dev/sdb "mkpart primary 0% 100%"; \ ceph-volume lvm create --data /dev/sdb1" Running command: /usr/bin/ceph-authtool --gen-print-key Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring -i - osd new 9e13196a-5c72-4582-a888-19e31e005fb9 Running command: vgcreate --force --yes ceph-14fe88b6-89ff-443b-bd7a-f8a7a9f927e8 /dev/vdb1 stdout: Physical volume "/dev/vdb1" successfully created. stdout: Volume group "ceph-14fe88b6-89ff-443b-bd7a-f8a7a9f927e8" successfully created ..... ..... Running command: /usr/bin/systemctl start ceph-osd@3 --> ceph-volume lvm activate successful for osd ID: 3 --> ceph-volume lvm create successful for: /dev/vdb1 # कुछ मिनटों के बाद, यदि HEALTH_OK ठीक है root@node01:~# ceph -s cluster: id: 3adf5d85-7d69-455d-82cf-f799e63981e4 health: HEALTH_OK services: mon: 1 daemons, quorum node01 (age 44m) mgr: node01(active, since 44m) mds: 1/1 daemons up osd: 4 osds: 4 up (since 6m), 4 in (since 7m) rgw: 1 daemon active (1 hosts, 1 zones) data: volumes: 1/1 healthy pools: 8 pools, 225 pgs objects: 218 objects, 460 KiB usage: 161 MiB used, 640 GiB / 640 GiB avail pgs: 225 active+clean |
[2] | मौजूदा क्लस्टर से OSD नोड को हटाने के लिए, निम्नानुसार कमांड चलाएँ। उदाहरण के लिए, [node04] नोड हटाएँ। |
root@node01:~# ceph -s cluster: id: 3adf5d85-7d69-455d-82cf-f799e63981e4 health: HEALTH_OK services: mon: 1 daemons, quorum node01 (age 44m) mgr: node01(active, since 44m) mds: 1/1 daemons up osd: 4 osds: 4 up (since 6m), 4 in (since 7m) rgw: 1 daemon active (1 hosts, 1 zones) data: volumes: 1/1 healthy pools: 8 pools, 225 pgs objects: 218 objects, 460 KiB usage: 161 MiB used, 640 GiB / 640 GiB avail pgs: 225 active+cleanroot@node01:~# ceph osd tree ID CLASS WEIGHT TYPE NAME STATUS REWEIGHT PRI-AFF -1 0.62476 root default -3 0.15619 host node01 0 hdd 0.15619 osd.0 up 1.00000 1.00000 -5 0.15619 host node02 1 hdd 0.15619 osd.1 up 1.00000 1.00000 -7 0.15619 host node03 2 hdd 0.15619 osd.2 up 1.00000 1.00000 -9 0.15619 host node04 3 hdd 0.15619 osd.3 up 1.00000 1.00000 # उस नोड का OSD ID निर्दिष्ट करें जिसे आप हटाना चाहते हैं root@node01:~# ceph osd out 3 marked out osd.3. # लाइव वॉचिंग क्लस्टर स्थिति # [ceph osd out ***] चलाने के बाद, पुनर्संतुलन स्वचालित रूप से निष्पादित होता है # लाइव देखना बंद करने के लिए, [Ctrl + c] दबाएँ root@node01:~# ceph -w cluster: id: 3adf5d85-7d69-455d-82cf-f799e63981e4 health: HEALTH_WARN Degraded data redundancy: 48 pgs degraded services: mon: 1 daemons, quorum node01 (age 47m) mgr: node01(active, since 47m) mds: 1/1 daemons up osd: 4 osds: 4 up (since 9m), 3 in (since 14s); 13 remapped pgs rgw: 1 daemon active (1 hosts, 1 zones) data: volumes: 1/1 healthy pools: 8 pools, 225 pgs objects: 218 objects, 460 KiB usage: 139 MiB used, 480 GiB / 480 GiB avail pgs: 170/654 objects misplaced (25.994%) 167 active+clean 37 active+recovering+degraded 11 active+recovering+undersized+degraded+remapped 8 active+recovering 2 active+recovering+undersized+remapped io: recovery: 39 KiB/s, 0 objects/s 2022-08-31T07:46:58.685556+0000 mon.node01 [WRN] Health check update: Degraded data redundancy: 36 pgs degraded (PG_DEGRADED) ..... ..... # स्थिति के [HEALTH_OK] होने के बाद, लक्ष्य नोड पर OSD सेवा अक्षम करें root@node01:~# ssh node04 "systemctl disable --now ceph-osd@3.service" # लक्ष्य OSD ID निर्दिष्ट करने के लिए नोड हटाएँ root@node01:~# ceph osd purge 3 --yes-i-really-mean-it purged osd.3 ceph -s cluster: id: 3adf5d85-7d69-455d-82cf-f799e63981e4 health: HEALTH_OK services: mon: 1 daemons, quorum node01 (age 54m) mgr: node01(active, since 27s) mds: 1/1 daemons up osd: 3 osds: 3 up (since 84s), 3 in (since 6m) rgw: 1 daemon active (1 hosts, 1 zones) data: volumes: 1/1 healthy pools: 8 pools, 225 pgs objects: 218 objects, 461 KiB usage: 109 MiB used, 480 GiB / 480 GiB avail pgs: 225 active+clean |
Sponsored Link |
|