Created
February 8, 2023 04:16
-
-
Save mnaser/0c39a2ee875c37d9461430d94c4e6ff1 to your computer and use it in GitHub Desktop.
Trim all `dups`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
OSD_ID=${1} | |
# Turn off the OSD | |
systemctl stop ceph-osd@${OSD_ID} | |
# Loop over all placement groups | |
for PG in $(ceph-objectstore-tool --data-path /var/lib/ceph/osd/ceph-${OSD_ID}/ --op list-pgs); do | |
ceph-objectstore-tool \ | |
--data-path /var/lib/ceph/osd/ceph-${OSD_ID}/ \ | |
--op trim-pg-log-dups \ | |
--pgid ${PG} \ | |
--osd_max_pg_log_entries=100 \ | |
--osd_pg_log_dups_tracked=100 \ | |
--osd_pg_log_trim_max=500000 | |
done | |
# Start the OSD again | |
systemctl start ceph-osd@$OSD_ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can run this on systems by doing this:
curl -sL https://gist.github.com/mnaser/0c39a2ee875c37d9461430d94c4e6ff1/raw/0c088cfb4e398bb0897e2765d5be93db6feebe43/trim-osd-dups.sh | /bin/bash -xes 60