2.5. 为 Ceph 对象网关创建和收集操作日志


用户身份信息添加到操作日志输出中。这用于使用户访问此信息以审核 S3 访问。跟踪 S3 请求在所有 Ceph 对象网关操作日志中可靠的用户身份。

流程

  1. 查找日志所在的位置:

    语法

    logrotate -f

    示例

    [root@host01 ~]# logrotate -f
    /etc/logrotate.d/ceph-12ab345c-1a2b-11ed-b736-fa163e4f6220

  2. 列出指定位置的日志:

    语法

    ll LOG_LOCATION

    示例

    [root@host01 ~]# ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220
     -rw-r--r--. 1 ceph ceph    412 Sep 28 09:26 opslog.log.1.gz

  3. 列出当前的存储桶:

    示例

    [root@host01 ~]# /usr/local/bin/s3cmd ls

  4. 创建存储桶:

    语法

    /usr/local/bin/s3cmd mb s3://NEW_BUCKET_NAME

    示例

    [root@host01 ~]# /usr/local/bin/s3cmd mb s3://bucket1
    Bucket `s3://bucket1` created

  5. 列出当前的日志:

    语法

    ll LOG_LOCATION

    示例

    [root@host01 ~]# ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220
     total 852
     ...
     -rw-r--r--. 1 ceph ceph    920 Jun 29 02:17 opslog.log
     -rw-r--r--. 1 ceph ceph    412 Jun 28 09:26 opslog.log.1.gz

  6. 收集日志:

    语法

    tail -f LOG_LOCATION/opslog.log

    示例

    [root@host01 ~]# tail -f /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220/opslog.log
    
    {"bucket":"","time":"2022-09-29T06:17:03.133488Z","time_local":"2022-09-
    29T06:17:03.133488+0000","remote_addr":"10.0.211.66","user":"test1",
    "operation":"list_buckets","uri":"GET /
    HTTP/1.1","http_status":"200","error_code":"","bytes_sent":232,
    "bytes_received":0,"object_size":0,"total_time":9,"user_agent":"","referrer":
    "","trans_id":"tx00000c80881a9acd2952a-006335385f-175e5-primary",
    "authentication_type":"Local","access_key_id":"1234","temp_url":false}
    
    {"bucket":"cn1","time":"2022-09-29T06:17:10.521156Z","time_local":"2022-09-
    29T06:17:10.521156+0000","remote_addr":"10.0.211.66","user":"test1",
    "operation":"create_bucket","uri":"PUT /cn1/
    HTTP/1.1","http_status":"200","error_code":"","bytes_sent":0,
    "bytes_received":0,"object_size":0,"total_time":106,"user_agent":"",
    "referrer":"","trans_id":"tx0000058d60c593632c017-0063353866-175e5-primary",
    "authentication_type":"Local","access_key_id":"1234","temp_url":false}

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.