Skip to content

Instantly share code, notes, and snippets.

@wido
Last active November 8, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wido/4fe4e5617947135bbae2d97f07e022c1 to your computer and use it in GitHub Desktop.
Save wido/4fe4e5617947135bbae2d97f07e022c1 to your computer and use it in GitHub Desktop.
Bootstrap Ceph Monitor
#!/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