ceph: 1、ceph常用命令

                ceph中常用命令总结


1 ceph中数据查看


 rados -p metrics ls | grep gnocc

rados -p metrics get gnocchi_00cd3818-05b8-4d6d-9f07-6d36b6814dc4_1519560000.0_mean_900.0_v3 /tmp/object3 
 

# od -x /tmp/object3

0000000 0000 0000 0000 0000 0000 0000 0000 0000*0067000 0100 0000 0000 0000 0000 0001 0000 00000067020 0000 00000067023

2 ceph中pool删除


ceph osd pool delete metrics metrics  --yes-i-really-really-mean-it

3 创建指定pg_number和pgp_number大小的pool


ceph osd pool create metrics 128 128

ceph osd pool create gnocchi 128 128
ceph auth get-or-create client.gnocchi mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=gnocchi'
ceph auth get-or-create client.gnocchi | tee ceph.client.gnocchi.keyring
sudo cp ./ceph.client.gnocchi.keyring /etc/ceph
ceph auth get-key client.gnocchi

4有关pools的操作


ceph auth list : 查看ceph集群中认证用户和key
删除某个用户的ceph的认证:
ceph auth del client.gnocchi
ceph osd lspools : lpools是list pools
显示集群中pool的详细信息
rados pool
查看gnocchi池的pg数量
ceph osd pool get gnocchi pg_num
查看ceph pool中的ceph object
rados ls -p gnocchi | more
清除数据:
rados purge gnocchi --yes-i-really-really-mean-it
rados df
显示出每个对象池占用的空间大小

删除所有关于gnocchi的ceph部分
删除pool
ceph osd pool delete gnocchi gnocchi  --yes-i-really-really-mean-it
删除认证
ceph auth del client.gnocchi
删除数据
rados purge gnocchi –yes-i-really-really-mean-it

5 ceph的pool的data删除


进入到ceph的osd的pod中
kubectl exec -it -n ceph ceph-osd-node-1-15b91e97-314d-4682-8036-106c183cd046-t75gt /bin/bash
删除现有的gnocchi监控项数据
rados purge metrics –yes-i-really-really-mean-it

6 查看pool中对象的值


查看一个pool中的对象
rados ls -p poolName | more
查看对象具体的值
rados -p poolName get objName directory
例如:
rados -p data get measure /tmp/object2 

猜你喜欢

转载自blog.csdn.net/qingyuanluofeng/article/details/83869853