ungleich-tools/ceph/ceph-mon-create-start
2021-02-07 12:42:50 +01:00

21 lines
511 B
Bash
Executable file

#!/bin/sh
monkey=$(mktemp)
monmap=$(mktemp)
ceph auth get mon. -o $monkey
ceph mon getmap -o $monmap
mkdir /var/lib/ceph/mon/ceph-$(hostname)
ceph-mon -i $(hostname) --mkfs --monmap $monmap --keyring $monkey
chown -R ceph:ceph /var/lib/ceph/mon/ceph-$(hostname)
# Fix broken permissions on Debian
chown ceph:ceph /var/run/ceph/
# Starting with monit, if available
if [ -e /etc/monit ]; then
/opt/ungleich-tools/monit-ceph-create-start mon.$(hostname)
else
/etc/init.d/ceph start mon.$(hostname)
fi