User Tools

Site Tools


ceph:troubleshooting:too_many_pgs_per_osd

[TROUBLESHOOT] Ceph too many pgs per osd

Documentation
Name: [TROUBLESHOOT] Ceph too many pgs per osd
Description: how to solve this “issue”
Modification date :11/04/2019
Owner:dodger@ciberterminal.net
Notify changes to:Owner
Tags:ceph, object storage

WARNING

This documents cover the TOO MANY PGs per OSD, not too few (documented here)

The solution

The solution is perfectly explained here:
https://stackoverflow.com/questions/39589696/ceph-too-many-pgs-per-osd-all-you-need-to-know
To keep the solution safe, I'll write here down it.

RAWPASTE

ceph pg dump | awk '
BEGIN { IGNORECASE = 1 }
 /^PG_STAT/ { col=1; while($col!="UP") {col++}; col++ }
 /^[0-9a-f]+\.[0-9a-f]+/ { match($0,/^[0-9a-f]+/); pool=substr($0, RSTART, RLENGTH); poollist[pool]=0;
 up=$col; i=0; RSTART=0; RLENGTH=0; delete osds; while(match(up,/[0-9]+/)>0) { osds[++i]=substr(up,RSTART,RLENGTH); up = substr(up, RSTART+RLENGTH) }
 for(i in osds) {array[osds[i],pool]++; osdlist[osds[i]];}
}
END {
 printf("\n");
 printf("pool :\t"); for (i in poollist) printf("%s\t",i); printf("| SUM \n");
 for (i in poollist) printf("--------"); printf("----------------\n");
 for (i in osdlist) { printf("osd.%i\t", i); sum=0;
   for (j in poollist) { printf("%i\t", array[i,j]); sum+=array[i,j]; sumpool[j]+=array[i,j] }; printf("| %i\n",sum) }
 for (i in poollist) printf("--------"); printf("----------------\n");
 printf("SUM :\t"); for (i in poollist) printf("%s\t",sumpool[i]); printf("|\n");
}'
old_pool=".rgw.buckets"
new_pool=new.default.rgw.buckets.data
ceph osd pool create ${new_pool} 32
rados cppool ${old_pool} ${new_pool}
ceph osd pool delete ${old_pool} ${old_pool} --yes-i-really-really-mean-it
ceph osd pool rename ${new_pool} ${old_pool}
ceph health

That's all


Procedure for dropping pool: [HOWTO] Completely remove a POOL from cluster

ceph/troubleshooting/too_many_pgs_per_osd.txt · Last modified: 2019/07/18 09:17 (external edit)