[ceph-users] Configuring ceph usage statistics

Jean-Charles Lopez jelopez at redhat.com
Mon Nov 20 15:00:02 PST 2017


Hi Richard,

you need to grant admin ops capabilities to a specific user to be able to query the usage stats.

radosgw-admin caps add --caps "usage=*;buckets=*;metadata=*;users=*;zone=*" --uid=johndoe

* can be replace with “read”, “read, write” depending on what you want the user to be able to do.

[root at ex-sem-1 ~]# radosgw-admin caps add --caps "usage=*;buckets=*;metadata=*;users=*;zone=*" --uid=johndoe
{
    "user_id": "johndoe",
    "display_name": "John Doe",
    "email": "jdoe at redhat.com",
    "suspended": 0,
    "max_buckets": 1000,
    "auid": 0,
    "subusers": [],
    "keys": [
        {
            "user": "johndoe",
            "access_key": “xxxxx",
            "secret_key": “yyyyy"
        }
    ],
    "swift_keys": [],
    "caps": [
        {
            "type": "buckets",
            "perm": "*"
        },
        {
            "type": "metadata",
            "perm": "*"
        },
        {
            "type": "usage",
            "perm": "*"
        },
        {
            "type": "users",
            "perm": "*"
        },
        {
            "type": "zone",
            "perm": "*"
        }
    ],
    "op_mask": "read, write, delete",
    "default_placement": "",
    "placement_tags": [],
    "bucket_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "user_quota": {
        "enabled": false,
        "max_size_kb": -1,
        "max_objects": -1
    },
    "temp_url_keys": []
}

[root at ex-sem-1 ~]# radosgw-admin usage show --uid=johndoe
{
    "entries": [
        {
            "user": "johndoe",
            "buckets": [
                {
                    "bucket": "bucket1",
                    "time": "2017-11-20 22:00:00.000000Z",
                    "epoch": 1511215200,
                    "owner": "johndoe",
                    "categories": [
                        {
                            "category": "put_obj",
                            "bytes_sent": 0,
                            "bytes_received": 3939,
                            "ops": 3,
                            "successful_ops": 3
                        }
                    ]
                }
            ]
        }
    ],
    "summary": [
        {
            "user": "johndoe",
            "categories": [
                {
                    "category": "put_obj",
                    "bytes_sent": 0,
                    "bytes_received": 3939,
                    "ops": 3,
                    "successful_ops": 3
                }
            ],
            "total": {
                "bytes_sent": 0,
                "bytes_received": 3939,
                "ops": 3,
                "successful_ops": 3
            }
        }
    ]
}

Play with the caps to allow what you feel is necessary.

Note that you also have this to check byte usage

[root at ex-sem-1 ~]# radosgw-admin user stats --uid=johndoe
{
    "stats": {
        "total_entries": 6,
        "total_bytes": 37307,
        "total_bytes_rounded": 53248
    },
    "last_stats_sync": "2017-07-22 22:50:37.572798Z",
    "last_stats_update": "2017-11-20 22:56:56.311295Z"
}

Best regards
JC

> On Nov 20, 2017, at 13:30, Richard Cox <richard.cox at pdfcomplete.com> wrote:
> 
> Attempting to set up a proof of concept ceph cluster (3 osd’s 1 mon node), and everything is working as far as radowsgw and s3 connectivity, however I can’t seem to get any usage statistics.
>  
> Looking at the documentation this is enabled by default, but just in case it isn’t, I have 
>  
> [client.radosgw.gateway]
>  
> rgw enable usage log = true
> rgw usage log tick interval = 30
> rgw usage log flush threshold = 1024
> rgw usage max shards = 32
> rgw usage max user shards = 1
>  
> I read and write to the cluster using a set up demo account; however when I try to view the usage stats:
>  
> radosgw-admin –uid=demo usage show
> {
>     "entries": [],
>     "summary": []
> }
>  
> I’m sure there’s something blindingly obvious that I’m missing, but I’m at my wits end to what it could be.
>  
> Thanks for any assistance!
>  
> Richard.
>  
> _______________________________________________
> ceph-users mailing list
> ceph-users at lists.ceph.com <mailto:ceph-users at lists.ceph.com>
> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com <http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ceph.com/pipermail/ceph-users-ceph.com/attachments/20171120/2cb8deb1/attachment.html>


More information about the ceph-users mailing list