Get the Number of Placement Groups Per Osd
Get the Number of Placement Groups Per Osd
壬癸甲乙 发表于3年前
Get the Number of Placement Groups Per Osd
  • 发表于 3年前
  • 阅读 97
  • 收藏 2
  • 点赞 1
  • 评论 0

Get the PG distribution per osd in command line :

ceph pg dump | awk '
 /^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]; poollist[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",poollist[i]); printf("|\n");
}'

结果:

dumped all in format plain

pool :	0	1	| SUM 
--------------------------------
osd.0	64	35	| 99
osd.1	64	47	| 111
osd.2	64	46	| 110
--------------------------------
SUM :	192	128	|



共有 人打赏支持
粉丝 147
博文 184
码字总数 241103
×
壬癸甲乙
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: