Ubuntu 22.04
Sponsored Link

Ceph Quincy : क्लस्टर कॉन्फ़िगर करें #22023/08/28

 
स्टोरेज क्लस्टर को कॉन्फ़िगर करने के लिए वितरित फ़ाइल सिस्टम Ceph स्थापित करें।
उदाहरण के लिए, यहां Ceph क्लस्टर को 3 नोड्स के साथ निम्नानुसार कॉन्फ़िगर करें।
इसके अलावा, प्रत्येक स्टोरेज नोड में सेफ नोड्स पर उपयोग करने के लिए एक निःशुल्क ब्लॉक डिवाइस है।
(यह इस उदाहरण पर [/dev/sdb] का उपयोग करता है)
                                         |
            +----------------------------+----------------------------+
            |                            |                            |
            |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]
[2] एडमिन नोड से प्रत्येक नोड पर OSD (ऑब्जेक्ट स्टोरेज डिवाइस) कॉन्फ़िगर करें।
ब्लॉक डिवाइस ([/dev/sdb] इस उदाहरण पर) OSD के लिए स्वरूपित हैं, यदि कुछ मौजूदा डेटा सहेजा गया है तो सावधान रहें।
# प्रत्येक नोड के लिए OSD के लिए सेटिंग्स कॉन्फ़िगर करें

root@node01:~# for NODE in node01 node02 node03
do
    if [ ! ${NODE} = "node01" ]
    then
        scp /etc/ceph/ceph.conf ${NODE}:/etc/ceph/ceph.conf
        scp /etc/ceph/ceph.client.admin.keyring ${NODE}:/etc/ceph
        scp /var/lib/ceph/bootstrap-osd/ceph.keyring ${NODE}:/var/lib/ceph/bootstrap-osd
    fi
    ssh $NODE \
    "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"
done 

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 f6d9e163-0df9-4a20-8450-5f89f3900372
Running command: vgcreate --force --yes ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8 /dev/vdb1
 stdout: Physical volume "/dev/vdb1" successfully created.
 stdout: Volume group "ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8" successfully created
Running command: lvcreate --yes -l 40959 -n osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372 ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8
 stdout: Logical volume "osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372" created.
Running command: /usr/bin/ceph-authtool --gen-print-key
Running command: /usr/bin/mount -t tmpfs tmpfs /var/lib/ceph/osd/ceph-0
--> Executable selinuxenabled not in PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
Running command: /usr/bin/chown -h ceph:ceph /dev/ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8/osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372
Running command: /usr/bin/chown -R ceph:ceph /dev/dm-1
Running command: /usr/bin/ln -s /dev/ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8/osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372 /var/lib/ceph/osd/ceph-0/block
Running command: /usr/bin/ceph --cluster ceph --name client.bootstrap-osd --keyring /var/lib/ceph/bootstrap-osd/ceph.keyring mon getmap -o /var/lib/ceph/osd/ceph-0/activate.monmap
 stderr: got monmap epoch 2
Running command: /usr/bin/ceph-authtool /var/lib/ceph/osd/ceph-0/keyring --create-keyring --name osd.0 --add-key AQBR9w5jzRD7KxAAXw+8h26IA6a1GVkqZW3upA==
 stdout: creating /var/lib/ceph/osd/ceph-0/keyring
 stdout: added entity osd.0 auth(key=AQBR9w5jzRD7KxAAXw+8h26IA6a1GVkqZW3upA==)
Running command: /usr/bin/chown -R ceph:ceph /var/lib/ceph/osd/ceph-0/keyring
Running command: /usr/bin/chown -R ceph:ceph /var/lib/ceph/osd/ceph-0/
Running command: /usr/bin/ceph-osd --cluster ceph --osd-objectstore bluestore --mkfs -i 0 --monmap /var/lib/ceph/osd/ceph-0/activate.monmap --keyfile - --osd-data /var/lib/ceph/osd/ceph-0/ --osd-uuid f6d9e163-0df9-4a20-8450-5f89f3900372 --setuser ceph --setgroup ceph
 stderr: 2022-08-31T05:53:23.379+0000 7fe48b96a5c0 -1 bluestore(/var/lib/ceph/osd/ceph-0/) _read_fsid unparsable uuid
--> ceph-volume lvm prepare successful for: /dev/vdb1
Running command: /usr/bin/chown -R ceph:ceph /var/lib/ceph/osd/ceph-0
Running command: /usr/bin/ceph-bluestore-tool --cluster=ceph prime-osd-dir --dev /dev/ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8/osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372 --path /var/lib/ceph/osd/ceph-0 --no-mon-config
Running command: /usr/bin/ln -snf /dev/ceph-242fd528-8e1f-44b0-bdc4-1c4f3c66ede8/osd-block-f6d9e163-0df9-4a20-8450-5f89f3900372 /var/lib/ceph/osd/ceph-0/block
Running command: /usr/bin/chown -h ceph:ceph /var/lib/ceph/osd/ceph-0/block
Running command: /usr/bin/chown -R ceph:ceph /dev/dm-1
Running command: /usr/bin/chown -R ceph:ceph /var/lib/ceph/osd/ceph-0
Running command: /usr/bin/systemctl enable ceph-volume@lvm-0-f6d9e163-0df9-4a20-8450-5f89f3900372
 stderr: Created symlink /etc/systemd/system/multi-user.target.wants/ceph-volume@lvm-0-f6d9e163-0df9-4a20-8450-5f89f3900372.service → /lib/systemd/system/ceph-volume@.service.
Running command: /usr/bin/systemctl enable --runtime ceph-osd@0
 stderr: Created symlink /run/systemd/system/ceph-osd.target.wants/ceph-osd@0.service → /lib/systemd/system/ceph-osd@.service.
Running command: /usr/bin/systemctl start ceph-osd@0
--> ceph-volume lvm activate successful for osd ID: 0
--> ceph-volume lvm create successful for: /dev/vdb1
ceph.conf                                     100%  273   166.0KB/s   00:00
ceph.client.admin.keyring                     100%  151    90.6KB/s   00:00
ceph.keyring                                  100%  129    79.9KB/s   00:00
.....
.....

# क्लस्टर स्थिति की पुष्टि करें
# यह ठीक है अगर [HEALTH_OK]

root@node01:~#
ceph -s

  cluster:
    id:     3adf5d85-7d69-455d-82cf-f799e63981e4
    health: HEALTH_OK

  services:
    mon: 1 daemons, quorum node01 (age 9m)
    mgr: node01(active, since 8m)
    osd: 3 osds: 3 up (since 74s), 3 in (since 3m)

  data:
    pools:   1 pools, 1 pgs
    objects: 2 objects, 449 KiB
    usage:   61 MiB used, 480 GiB / 480 GiB avail
    pgs:     1 active+clean

# OSD ट्री की पुष्टि करें

root@node01:~#
ceph osd tree

ID  CLASS  WEIGHT   TYPE NAME        STATUS  REWEIGHT  PRI-AFF
-1         0.46857  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

root@node01:~# ceph df 
--- RAW STORAGE ---
CLASS     SIZE    AVAIL    USED  RAW USED  %RAW USED
hdd    480 GiB  480 GiB  61 MiB    61 MiB       0.01
TOTAL  480 GiB  480 GiB  61 MiB    61 MiB       0.01

--- POOLS ---
POOL  ID  PGS   STORED  OBJECTS     USED  %USED  MAX AVAIL
.mgr   1    1  389 KiB        2  1.1 MiB      0    152 GiB

root@node01:~# ceph osd df 
ID  CLASS  WEIGHT   REWEIGHT  SIZE     RAW USE  DATA     OMAP  META    AVAIL    %USE  VAR   PGS  STATUS
 0    hdd  0.15619   1.00000  160 GiB   20 MiB  544 KiB   0 B  20 MiB  160 GiB  0.01  1.00    1      up
 1    hdd  0.15619   1.00000  160 GiB   20 MiB  544 KiB   0 B  20 MiB  160 GiB  0.01  1.00    1      up
 2    hdd  0.15619   1.00000  160 GiB   20 MiB  540 KiB   0 B  20 MiB  160 GiB  0.01  1.00    1      up
                       TOTAL  480 GiB   61 MiB  1.6 MiB   0 B  59 MiB  480 GiB  0.01
MIN/MAX VAR: 1.00/1.00  STDDEV: 0
मिलान सामग्री