Uncategorized

Ceph:How to remove objects from pool

How can we remove the objects from a pool, without removing the pool.
We can be “rados -p cleanup –prefix ” to remove all the objects,  with a specific prefix.

 

First check all the objects in that pool, use the below command:

 

$ rados -p  ls
For example, If you wanted to clean up  the ‘rados bench write’ testing objects, you can use the below command for the same:
$ rados -p  --prefix cleanu benchmark’
$ rados -p rbdbench  cleanup --prefix benchmark // will remove all objects prefixed with benchmake

You can also remove all the objects from a pool as below, but note that, the below command will delete all the objects in that pool, so be careful to use the below command. 

$ for i in `rados -p  ls; do echo $i; rados -p  rm $i; done’
Advertisements

One thought on “Ceph:How to remove objects from pool

  1. Hello swami,
    I have a ceph 3 node cluster for a openstack environment with 131TB of which two nodes are 65 tb and third one is 120gb (using the same disk for base OS and ceph)
    Installed it using miranits Fuel 9.0.

    when i do a ceph -s i get the following

    root@storage1:~# ceph -s
    cluster 9a88d1b6-0161-4323-bf01-8f3fb6cf493a
    health HEALTH_WARN
    2040 pgs degraded
    2040 pgs stuck degraded
    2347 pgs stuck unclean
    2040 pgs stuck undersized
    2040 pgs undersized
    recovery 108/165 objects degraded (65.455%)
    monmap e3: 3 mons at {controller=192.168.30.7:6789/0,controller2=192.168.30.2:6789/0,controller3=192.168.30.1:6789/0}
    election epoch 10, quorum 0,1,2 controller3,controller2,controller
    osdmap e180: 30 osds: 30 up, 30 in; 307 remapped pgs
    pgmap v3346: 2432 pgs, 10 pools, 22104 kB data, 55 objects
    62862 MB used, 131 TB / 131 TB avail
    108/165 objects degraded (65.455%)
    2040 active+undersized+degraded
    295 active+remapped
    85 active+clean
    12 active

    Can you explain why i am getting this warnings.

    Thanks,
    Vikramsimha

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s