Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: change default ops log backend from rados to file #45737

Merged
merged 4 commits into from Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions PendingReleaseNotes
@@ -1,3 +1,9 @@
>=18.0.0

* RGW's default backend for `rgw_enable_ops_log` changed from RADOS to file.
The default value of `rgw_ops_log_rados` is now false, and `rgw_ops_log_file_path`
defaults to "/var/log/ceph/ops-log-$cluster-$name.log".

>=17.0.0

* Filestore has been deprecated in Quincy, considering that BlueStore has been
Expand Down
13 changes: 10 additions & 3 deletions src/common/options/rgw.yaml.in
Expand Up @@ -1447,14 +1447,19 @@ options:
type: bool
level: advanced
desc: Use RADOS for ops log
long_desc: If set, RGW will store ops log information in RADOS.
long_desc: If set, RGW will store ops log information in RADOS. WARNING,
there is no automation to clean up these log entries, so by default they
will pile up without bound. This MUST NOT be enabled unless the admin has
a strategy to manage and trim these log entries with `radosgw-admin log rm`.
fmt_desc: Whether the operations log should be written to the
Ceph Storage Cluster backend.
default: true
default: false
services:
- rgw
see_also:
- rgw_enable_ops_log
- rgw_log_object_name_utc
- rgw_log_object_name
with_legacy: true
# path to unix domain socket where ops log can go
- name: rgw_ops_log_socket_path
Expand All @@ -1475,8 +1480,10 @@ options:
type: str
level: advanced
desc: File-system path for ops log.
long_desc: Path to file that RGW will log ops logs to.
long_desc: Path to file that RGW will log ops logs to. A cephadm deployment will automatically
rotate these logs under /var/log/ceph/. Other deployments should arrange for similar log rotation.
fmt_desc: The file-system path for writing operations logs.
daemon_default: /var/log/ceph/ops-log-$cluster-$name.log
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that i copied this from the log_file option which defaults to /var/log/ceph/$cluster-$name.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfsnyder i'd like to add a blurb about log rotation for rgw_ops_log_file_path. can you summarize how cephadm does this, or point me at docs maybe?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure @cbodley. cephadm automatically adds logrotate config on the host for all files matching /var/log/ceph/{fsid}/*.log. So if the rgw_ops_log_file_path config param matches /var/log/ceph/*.log (container path), it'll be handled by the cephadm config.

Here's an example of the config it generated on one of my test clusters:

root@ceph01:~# cat /etc/logrotate.d/ceph-74016538-b125-11ec-abb9-3daf21fa986b 
# created by cephadm
/var/log/ceph/74016538-b125-11ec-abb9-3daf21fa986b/*.log {
    rotate 7
    daily
    compress
    sharedscripts
    postrotate
        chown 167:167 /var/log/ceph/74016538-b125-11ec-abb9-3daf21fa986b/*.log; killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror cephfs-mirror || pkill -1 -x 'ceph-mon|ceph-mgr|ceph-mds|ceph-osd|ceph-fuse|radosgw|rbd-mirror|cephfs-mirror' || true
    endscript
    missingok
    notifempty
    su root root
}

As you can see, it rotates daily and keeps 7 days of compressed logs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's great, thanks

services:
- rgw
see_also:
Expand Down
1 change: 1 addition & 0 deletions src/test/cli/ceph-conf/show-config.t
Expand Up @@ -2,5 +2,6 @@
admin_socket = /var/run/ceph/ceph-osd.0.asok
log_file = /var/log/ceph/ceph-osd.0.log
mon_debug_dump_location = /var/log/ceph/ceph-osd.0.tdump
rgw_ops_log_file_path = /var/log/ceph/ops-log-ceph-osd.0.log
$ CEPH_ARGS="--fsid 96a3abe6-7552-4635-a79b-f3c096ff8b95" ceph-conf -n osd.0 --show-config -c /dev/null | grep fsid
fsid = 96a3abe6-7552-4635-a79b-f3c096ff8b95