molpako / ceph-cluster

0 stars 0 forks source link

Recovery POOL_FULL, OSD_FULL #6

Open molpako opened 8 months ago

molpako commented 8 months ago

CephFS上にでかいファイル作ってPOOL_FULLの状態を作った

root@mon2:/# ceph df
--- RAW STORAGE ---
CLASS     SIZE   AVAIL     USED  RAW USED  %RAW USED
hdd    333 GiB  70 GiB  264 GiB   264 GiB      79.14
TOTAL  333 GiB  70 GiB  264 GiB   264 GiB      79.14

--- POOLS ---
POOL             ID  PGS   STORED  OBJECTS     USED   %USED  MAX AVAIL
.mgr              1    1  598 KiB        2  1.8 MiB  100.00        0 B
cephfs_metadata   5   32  2.5 MiB       42  7.8 MiB  100.00        0 B
cephfs_data       6  128   87 GiB   22.39k  262 GiB  100.00        0 B
cephfs_data_ec    7   32      0 B        0      0 B       0        0 B

health detail

root@mon2:/# ceph health detail
HEALTH_ERR 1 backfillfull osd(s); 1 full osd(s); 1 nearfull osd(s); 4 pool(s) full
[WRN] OSD_BACKFILLFULL: 1 backfillfull osd(s)
    osd.4 is backfill full
[ERR] OSD_FULL: 1 full osd(s)
    osd.3 is full
[WRN] OSD_NEARFULL: 1 nearfull osd(s)
    osd.6 is near full
[WRN] POOL_FULL: 4 pool(s) full
    pool '.mgr' is full (no space)
    pool 'cephfs_metadata' is full (no space)
    pool 'cephfs_data' is full (no space)
    pool 'cephfs_data_ec' is full (no space)
molpako commented 8 months ago

BACKFILL とは

Cephはクラスタに新しいOSDを追加や削除したときに、PGのリバランシングを行う。これをバックフィルというらしい。

OSD_BACKFILLFULL

backfillfull しきい値を超えた OSD。デフォルト値は90%

しきい値を超えた OSD はリバランシングの対象から外れる。対処法は新しいOSDの追加。

root@mon2:/# ceph osd df osd.4
ID  CLASS  WEIGHT   REWEIGHT  SIZE    RAW USE  DATA    OMAP  META     AVAIL    %USE   VAR   PGS  STATUS
 4    hdd  0.01819   1.00000  19 GiB   18 GiB  17 GiB   0 B  185 MiB  1.0 GiB  94.50  1.00   39      up
...
molpako commented 8 months ago

OSD_NEARFULL

nearfull_ratio を超えたOSD。デフォルト値は85%

root@mon2:/# ceph osd df osd.6
ID  CLASS  WEIGHT   REWEIGHT  SIZE    RAW USE  DATA    OMAP     META     AVAIL    %USE   VAR   PGS  STATUS
 6    hdd  0.01819   1.00000  19 GiB   17 GiB  16 GiB    5 KiB  121 MiB  2.1 GiB  88.88  1.00   38      up
...

各しきい値は ceph osd dump で確認できる

root@mon2:/# ceph osd dump | grep _ratio
full_ratio 0.95
backfillfull_ratio 0.9
nearfull_ratio 0.85
molpako commented 8 months ago

OSD_FULL

full_ratio 95 % を超えた OSD。上2つと違い、書き込みそのものができなくなっている

root@mon2:/# ceph osd df osd.3
ID  CLASS  WEIGHT   REWEIGHT  SIZE    RAW USE  DATA    OMAP  META     AVAIL    %USE   VAR   PGS  STATUS
 3    hdd  0.01819   1.00000  19 GiB   18 GiB  18 GiB   0 B  250 MiB  829 MiB  95.65  1.00   49      up
                       TOTAL  19 GiB   18 GiB  18 GiB   0 B  250 MiB  829 MiB  95.65

短期的な回避策はしきい値をあげること

molpako commented 8 months ago

POOL_FULL

poolがいっぱいになって書き込めない状態

root@mon2:/# ceph df detail
--- RAW STORAGE ---
CLASS     SIZE   AVAIL     USED  RAW USED  %RAW USED
hdd    333 GiB  70 GiB  264 GiB   264 GiB      79.14
TOTAL  333 GiB  70 GiB  264 GiB   264 GiB      79.14

--- POOLS ---
POOL             ID  PGS   STORED   (DATA)  (OMAP)  OBJECTS     USED   (DATA)  (OMAP)   %USED  MAX AVAIL  QUOTA OBJECTS  QUOTA BYTES  DIRTY  USED COMPR  UNDER COMPR
.mgr              1    1  598 KiB  598 KiB     0 B        2  1.8 MiB  1.8 MiB     0 B  100.00        0 B            N/A          N/A    N/A         0 B          0 B
cephfs_metadata   5   32  2.5 MiB  2.5 MiB  13 KiB       42  7.8 MiB  7.8 MiB  38 KiB  100.00        0 B            N/A          N/A    N/A         0 B          0 B
cephfs_data       6  128   87 GiB   87 GiB     0 B   22.39k  262 GiB  262 GiB     0 B  100.00        0 B            N/A          N/A    N/A         0 B          0 B
cephfs_data_ec    7   32      0 B      0 B     0 B        0      0 B      0 B     0 B       0        0 B            N/A          N/A    N/A         0 B          0 B

たしかに書き込みできない

root@client1:/mnt# echo "A" > cant_write
bash: cant_write: Permission denied

molpako commented 7 months ago

reweight なんかしてみたがだめ。

root@mon2:/# ceph osd reweight-by-utilization 110 0.2 12
moved 20 / 611 (3.27332%)
avg 43.6429
stddev 7.28606 -> 8.32901 (expected baseline 6.36596)
min osd.4 with 29 -> 29 pgs (0.664484 -> 0.664484 * mean)
max osd.12 with 62 -> 62 pgs (1.42062 -> 1.42062 * mean)

oload 110
max_change 0.2
max_change_osds 12
average_utilization 0.7938
overload_utilization 0.8732
osd.9 weight 1.0000 -> 0.8195
osd.0 weight 1.0000 -> 0.8417
osd.7 weight 1.0000 -> 0.8837
osd.4 weight 0.8376 -> 0.8400

100%近いusedになり、複数osdが立ち上がらなってしまった。

molpako commented 7 months ago
$ ceph orch host drain osd3 --force --zap-osd-devices

作り直した

root@mon2:/# ceph osd df
ID  CLASS  WEIGHT   REWEIGHT  SIZE     RAW USE  DATA     OMAP     META     AVAIL    %USE  VAR   PGS  STATUS
 2    hdd  0.02910   1.00000   30 GiB  299 MiB   12 MiB    6 KiB  287 MiB   30 GiB  0.98  1.05   87      up
 5    hdd  0.02910   1.00000   30 GiB  262 MiB   12 MiB   11 KiB  250 MiB   30 GiB  0.86  0.92   66      up
 8    hdd  0.02910   1.00000   30 GiB  273 MiB   12 MiB    4 KiB  261 MiB   30 GiB  0.89  0.96   38      up
10    hdd  0.02910   1.00000   30 GiB  296 MiB   13 MiB    9 KiB  283 MiB   30 GiB  0.97  1.04   59      up
 0    hdd  0.01819   0.84172   19 GiB  104 MiB   12 MiB   85 KiB   91 MiB   19 GiB  0.54  0.58   58      up
 1    hdd  0.01819   1.00000   19 GiB   91 MiB   12 MiB      0 B   79 MiB   19 GiB  0.48  0.51   71      up
 3    hdd  0.01819   0.82806   19 GiB  121 MiB   12 MiB   80 KiB  108 MiB   19 GiB  0.63  0.68  118      up
14    hdd  0.01819   1.00000   19 GiB  184 MiB   12 MiB      0 B  171 MiB   18 GiB  0.96  1.03   47      up
15    hdd  0.01819   1.00000   19 GiB  188 MiB   13 MiB      0 B  175 MiB   18 GiB  0.99  1.06   69      up
16    hdd  0.01819   1.00000   19 GiB  160 MiB   12 MiB      0 B  148 MiB   18 GiB  0.84  0.90   83      up
17    hdd  0.01819   1.00000   19 GiB  188 MiB   12 MiB      0 B  175 MiB   18 GiB  0.98  1.06   51      up
11    hdd  0.02730   1.00000   28 GiB  354 MiB   12 MiB      0 B  342 MiB   28 GiB  1.24  1.33   48      up
12    hdd  0.02730   1.00000   28 GiB  350 MiB   12 MiB      0 B  338 MiB   28 GiB  1.22  1.31  133      up
13    hdd  0.02730   1.00000   28 GiB  311 MiB   13 MiB      0 B  299 MiB   28 GiB  1.09  1.17   67      up
                       TOTAL  333 GiB  3.1 GiB  175 MiB  198 KiB  2.9 GiB  330 GiB  0.93
MIN/MAX VAR: 0.51/1.33  STDDEV: 0.22