26 lines
579 B
Bash
Executable file
26 lines
579 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "$0 initial-key-file"
|
|
exit 1
|
|
fi
|
|
|
|
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
|