Last active
November 8, 2017 12:10
-
-
Save wido/4fe4e5617947135bbae2d97f07e022c1 to your computer and use it in GitHub Desktop.
Bootstrap Ceph Monitor
This file contains 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 | |
# | |
# Quickly bootstrap a Ceph Monitor | |
# | |
# Source: http://docs.ceph.com/docs/master/dev/mon-bootstrap/ | |
# | |
# Tested with Ceph Luminous | |
apt-get install -y ceph | |
ceph-authtool --create-keyring /etc/ceph/mon.keyring --gen-key -n mon. | |
ceph-authtool /etc/ceph/mon.keyring --gen-key -n client.admin --set-uid=0 --cap mon 'allow *' --cap osd 'allow *' --cap mds 'allow' | |
monmaptool --create /etc/ceph/monmap | |
monmaptool --add $(hostname -s) [::1] /etc/ceph/monmap | |
ceph-mon --mkfs -i $(hostname -s) --monmap /etc/ceph/monmap --keyring /etc/ceph/mon.keyring | |
chown -R ceph:ceph /var/lib/ceph/mon/* | |
systemctl start ceph-mon@$(hostname -s) | |
ceph auth get-or-create-key client.bootstrap-osd mon 'allow profile bootstrap-osd' | |
ceph auth get client.bootstrap-osd -o /var/lib/ceph/bootstrap-osd/ceph.keyring | |
chown ceph:ceph /var/lib/ceph/bootstrap-osd/ceph.keyring |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment