[jewel][rgw]why the usage log record date is 16 hours later than the real operate time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all, 
  i want get the usage of user,so i use the command radosgw-admin usage show ,but i can not get the usage when i use the --start-date unless  minus 16 hours

i have rgw both on ceph01 and ceph03,civeweb:7480 port ,and the ceph version is jewel 10.2.2

the time zone of ceph01 and ceph03
[root@ceph03 ~]# ls -l /etc/localtime 
lrwxrwxrwx 1 root root 35 Jul 25 07:40 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
[root@ceph03 ~]# ssh ceph01 ls -l /etc/localtime 
lrwxrwxrwx 1 root root 35 Jul 25 14:14 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai


the timedateclt of ceph03

[root@ceph03 ~]# timedatectl 
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.

      Local time: Fri 2016-07-29 08:28:44 CST
  Universal time: Fri 2016-07-29 00:28:44 UTC
        RTC time: Fri 2016-07-29 00:28:44
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

the timedate of ceph01
[root@ceph03 ~]# ssh ceph01 timedatectl
      Local time: Fri 2016-07-29 08:32:43 CST
  Universal time: Fri 2016-07-29 00:32:43 UTC
        RTC time: Fri 2016-07-29 08:32:43
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a


i create bucket use the python script test2.py

[root@ceph01 ~]# cat  test2.py    
import requests
import logging
from datetime import *
from requests_toolbelt.utils import dump
from awsauth import S3Auth
# host = 'yuliyangdebugwebjewel.tunnel.qydev.com'
#host = 'yuliyangdebugweb68.tunnel.qydev.com'
#host = '10.254.9.20:7480'
host = '10.254.3.68:7480' #ceph03
#host = '127.0.0.1:7480'  #ceph01
logging.basicConfig(level=logging.DEBUG)
access_key = 'date2'
secret_key = 'date2'
cmd = '/%s' % '{:%m_%d.%H_%M_%S}'.format(datetime.now())
#cmd = '/%s' % '{:%m_%d.%H_%M_%S}'.format(datetime.now() - timedelta(hours=16))
url = "" % (host,cmd)
response = requests.put(url,auth=S3Auth(access_key, secret_key,service_url=host))

data = "">
print(data.decode('utf-8'))


and it's output

INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 10.254.3.68
DEBUG:requests.packages.urllib3.connectionpool:"PUT /07_29.08_34_42 HTTP/1.1" 200 0
< PUT /07_29.08_34_42 HTTP/1.1
< Content-Length: 0
< Accept-Encoding: gzip, deflate
< Accept: */*
< User-Agent: python-requests/2.6.0 CPython/2.7.5 Linux/3.10.0-327.el7.x86_64
< Connection: keep-alive
< date: Fri, 29 Jul 2016 00:34:42 GMT
< Authorization: AWS date2:F+KLuenLNP42e25P/My/VWoUkeA=

> HTTP/1.1 200 OK
> date: Fri, 29 Jul 2016 00:34:42 GMT
> content-length: 0
> x-amz-request-id: tx000000000000000016112-00579aa4a2-c4c4f-default
> connection: Keep-Alive



but the usage show the bucket create 16 hours before

[root@ceph01 ~]# radosgw-admin usage show --uid=date2 |grep 07_29.08_34_42  -A30                        
                    "bucket": "07_29.08_34_42",
                    "time": "2016-07-28 16:00:00.000000Z",
                    "epoch": 1469721600,
                    "owner": "date2",
                    "categories": [
                        {
                            "category": "create_bucket",
                            "bytes_sent": 19,
                            "bytes_received": 0,
                            "ops": 1,
                            "successful_ops": 1
                        }
                    ]
                },


the time("time": "2016-07-28 16:00:00.000000Z",) is 16 hours later than  Local time: Fri 2016-07-29 08:28:44 CST

i can get the usage show by radosgw-admin usage show --uid=date2 --start-date="2016-07-28 16:00:00"
[root@ceph03 ~]# radosgw-admin usage show --uid=date2 --start-date="2016-07-28 16:00:00"
{
    "entries": [
        {
            "user": "date2",
            "buckets": [
                {
                    "bucket": "07_29.08_34_42",
                    "time": "2016-07-28 16:00:00.000000Z",
                    "epoch": 1469721600,
                    "owner": "date2",
                    "categories": [
                        {
                            "category": "create_bucket",
                            "bytes_sent": 19,
                            "bytes_received": 0,
                            "ops": 1,
                            "successful_ops": 1
                        }
                    ]
                }
            ]
        }
    ],
    "summary": [
        {
            "user": "date2",
            "categories": [
                {
                    "category": "create_bucket",
                    "bytes_sent": 19,
                    "bytes_received": 0,
                    "ops": 1,
                    "successful_ops": 1
                }
            ],
            "total": {
                "bytes_sent": 19,
                "bytes_received": 0,
                "ops": 1,
                "successful_ops": 1
            }
        }
    ]
}
but this radosgw-admin usage show --uid=date2 --start-date="2016-07-28 16:00:01" can not get the usage 
[root@ceph03 ~]# radosgw-admin usage show --uid=date2 --start-date="2016-07-28 16:00:01"
{
    "entries": [],
    "summary": []
}

so how to get the correct usage?
i have try to modify the clock_offset in ceph.conf file

[client.rgw.ceph01]
host = ceph01
rgw thread pool size = 1000
clock_offset =57600   #16 hours
and it works.

but is it harmful  to  modify clock_offset and have some unknown problem?


_______________________________________________
ceph-users mailing list
ceph-users@xxxxxxxxxxxxxx
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

[Index of Archives]     [Information on CEPH]     [Linux Filesystem Development]     [Ceph Development]     [Ceph Large]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [xfs]


  Powered by Linux