From f8ac6c3f2160d996c5294837259f3e1fb19b65ca Mon Sep 17 00:00:00 2001 From: Matthew Heler Date: Sun, 21 Oct 2018 14:18:46 -0500 Subject: [PATCH] ceph co-location journal and permission fixes Support co-located journals with Ceph helm chart Ensure proper ownership set on OSD/Journal disks Change-Id: Ic954d75c8bd7532991dc9b3184ad6d74b97855d1 --- ceph-osd/templates/bin/osd/_block.sh.tpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ceph-osd/templates/bin/osd/_block.sh.tpl b/ceph-osd/templates/bin/osd/_block.sh.tpl index 1fad423e1..749e51724 100644 --- a/ceph-osd/templates/bin/osd/_block.sh.tpl +++ b/ceph-osd/templates/bin/osd/_block.sh.tpl @@ -143,6 +143,9 @@ if [ "${OSD_BLUESTORE:-0}" -ne 1 ]; then JDEV="$(echo "${OSD_JOURNAL}" | sed 's/\(.*[^0-9]\)[0-9]*$/\1/')" if [ -d "/sys/block/$(basename "${JDEV}")/$(basename "${OSD_JOURNAL}")" ]; then OSD_JOURNAL="$(dev_part "${JDEV}" "$(echo "${OSD_JOURNAL}" | sed 's/.*[^0-9]\([0-9]*\)$/\1/')")" + elif [ "${OSD_DEVICE}" == "${OSD_JOURNAL}" ]; then + # journal and osd disk are on the same device. + OSD_JOURNAL="$(dev_part "${OSD_JOURNAL}" 2)" else # they likely supplied a bare device and prepare created partition 1. OSD_JOURNAL="$(dev_part "${OSD_JOURNAL}" 1)" @@ -159,12 +162,12 @@ if [ "${OSD_BLUESTORE:-0}" -ne 1 ]; then exit 1 else wait_for_file "${OSD_JOURNAL}" - chown ceph. "${OSD_JOURNAL}" + chown ceph. "${OSD_JOURNAL}" "${DATA_PART}" fi fi else wait_for_file "${JOURNAL_PART}" - chown ceph. "${JOURNAL_PART}" + chown ceph. "${JOURNAL_PART}" "${DATA_PART}" OSD_JOURNAL="${JOURNAL_PART}" fi CEPH_OSD_OPTIONS="${CEPH_OSD_OPTIONS} --osd-journal ${OSD_JOURNAL}"