deep_scrub_choked
This commit is contained in:
@@ -0,0 +1 @@
|
||||
# {{ ansible_managed }}
|
||||
@@ -0,0 +1,42 @@
|
||||
# {{ ansible_managed }}
|
||||
[Unit]
|
||||
Description=Ceph OSD
|
||||
PartOf=ceph-osd.target
|
||||
{% if container_binary == 'docker' %}
|
||||
After=docker.service network-online.target local-fs.target time-sync.target
|
||||
Requires=docker.service
|
||||
{% else %}
|
||||
After=network-online.target local-fs.target time-sync.target
|
||||
{% endif %}
|
||||
Wants=network-online.target local-fs.target time-sync.target
|
||||
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_osd_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_osd_docker_cpu_limit|int %}
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/environment
|
||||
{% if container_binary == 'podman' %}
|
||||
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-osd-%i
|
||||
ExecStartPre=-/usr/bin/mkdir -p /var/log/ceph
|
||||
ExecStartPre=-/usr/bin/mkdir -p /var/lib/ceph/osd/{{ cluster }}-%i
|
||||
{% else %}
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} stop ceph-osd-%i
|
||||
{% endif %}
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-osd-%i
|
||||
ExecStart=/bin/bash /var/lib/ceph/osd/{{ cluster }}-%i/run %t %n
|
||||
{% if container_binary == 'podman' %}
|
||||
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
||||
{% else %}
|
||||
ExecStop=-/usr/bin/{{ container_binary }} stop --timeout 120 ceph-osd-%i
|
||||
{% endif %}
|
||||
KillMode=none
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStartSec=120
|
||||
TimeoutStopSec=120
|
||||
{% if container_binary == 'podman' %}
|
||||
Type=forking
|
||||
PIDFile=/%t/%n-pid
|
||||
{% endif %}
|
||||
|
||||
[Install]
|
||||
WantedBy=ceph.target
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/bin/sh
|
||||
{% set cpu_limit = ansible_facts['processor_vcpus']|int if ceph_osd_docker_cpu_limit|int > ansible_facts['processor_vcpus']|int else ceph_osd_docker_cpu_limit|int %}
|
||||
OSD_ID={{ item }}
|
||||
T=$1
|
||||
N=$2
|
||||
CEPH_VOLUME_CMD="/usr/bin/{{ container_binary }} run --rm --net=host --privileged=true --pid=host --ipc=host -v /dev:/dev -v /etc/localtime:/etc/localtime:ro -v /var/lib/ceph/osd/{{ cluster }}-${OSD_ID}:/var/lib/ceph/osd/{{ cluster }}-${OSD_ID}:z -v /etc/ceph:/etc/ceph:z -v /var/run/ceph:/var/run/ceph:z -v /var/run/udev/:/var/run/udev/ -v /var/log/ceph:/var/log/ceph:z -v /run/lvm/:/run/lvm/ --entrypoint=ceph-volume {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
||||
PYTHON=python3
|
||||
CEPH_VOLUME_LIST_JSON="$($CEPH_VOLUME_CMD lvm list --format json)"
|
||||
|
||||
# Find the OSD FSID from the OSD ID
|
||||
OSD_FSID="$(echo "$CEPH_VOLUME_LIST_JSON" | $PYTHON -c "import sys, json; print(json.load(sys.stdin)['$OSD_ID'][0]['tags']['ceph.osd_fsid'])")"
|
||||
|
||||
# Find the OSD type
|
||||
OSD_TYPE="$(echo "$CEPH_VOLUME_LIST_JSON" | $PYTHON -c "import sys, json; print(json.load(sys.stdin)['$OSD_ID'][0]['type'])")"
|
||||
|
||||
# Discover the objectstore
|
||||
if [[ "block wal db" =~ $OSD_TYPE ]]; then
|
||||
OSD_OBJECTSTORE=(--bluestore)
|
||||
else
|
||||
log "Unable to discover osd objectstore for OSD type: $OSD_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# activate
|
||||
$CEPH_VOLUME_CMD lvm activate --no-systemd ${OSD_OBJECTSTORE[@]} ${OSD_ID} ${OSD_FSID}
|
||||
|
||||
# start ceph-osd
|
||||
{% if ceph_osd_numactl_opts != "" %}
|
||||
numactl \
|
||||
{{ ceph_osd_numactl_opts }} \
|
||||
{% endif %}
|
||||
/usr/bin/{{ container_binary }} run \
|
||||
{% if container_binary == 'podman' %}
|
||||
-d --log-driver journald --conmon-pidfile /${T}/${N}-pid --cidfile /${T}/${N}-cid \
|
||||
{% endif %}
|
||||
--pids-limit={{ 0 if container_binary == 'podman' else -1 }} \
|
||||
--rm --net=host --privileged=true --pid=host \
|
||||
--ipc=host \
|
||||
--cpus={{ cpu_limit }} \
|
||||
{% if ceph_osd_docker_cpuset_cpus is defined -%}
|
||||
--cpuset-cpus='{{ ceph_osd_docker_cpuset_cpus }}' \
|
||||
{% endif -%}
|
||||
{% if ceph_osd_docker_cpuset_mems is defined -%}
|
||||
--cpuset-mems='{{ ceph_osd_docker_cpuset_mems }}' \
|
||||
{% endif -%}
|
||||
{% for v in ceph_common_container_params['volumes'] + ceph_osd_container_params['volumes'] | default([]) %}
|
||||
-v {{ v }} \
|
||||
{% endfor %}
|
||||
{% if ansible_facts['distribution'] == 'Ubuntu' -%}
|
||||
--security-opt apparmor=unconfined \
|
||||
{% endif -%}
|
||||
{% for k, v in (ceph_common_container_params['envs'] | combine(ceph_osd_container_params['envs'] | default({}))).items() %}
|
||||
-e {{ k }}={{ v }} \
|
||||
{% endfor %}
|
||||
--name=ceph-osd-${OSD_ID} \
|
||||
--entrypoint=/usr/bin/ceph-osd \
|
||||
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||
{{ (ceph_common_container_params['args'] + ceph_osd_container_params['args'] | default([])) | join(' ') }}
|
||||
@@ -0,0 +1,3 @@
|
||||
{{ '# ' + ansible_managed }}
|
||||
|
||||
{{ 'w /sys/kernel/mm/transparent_hugepage/enabled - - - - never' }}
|
||||
Reference in New Issue
Block a user