Skip to content

Instantly share code, notes, and snippets.

@dotSlashLu
Created May 24, 2018 08:01
Show Gist options
  • Save dotSlashLu/89891c076996eb24afe1d877f7cd0c06 to your computer and use it in GitHub Desktop.
Save dotSlashLu/89891c076996eb24afe1d877f7cd0c06 to your computer and use it in GitHub Desktop.
Luminous deploy script
# Usage: bash mon.sh short-hostname
# You should first change the node's hostname, e.g.
# hostnamectl set-hostname mon1.ceph
# Then add it to ~/.ssh/config, e.g.
# Host mon1
dst=$1
ssh $dst systemctl stop firewalld
ssh $dst systemctl disable firewalld
scp /etc/yum.conf $dst:/etc/
scp /etc/yum.repos.d/* $dst:/etc/yum.repos.d/
ssh $dst yum clean all
ssh $dst yum install -y ceph-mon
scp /tmp/ceph.mon.keyring $dst:/tmp/
scp /tmp/monmap $dst:/tmp/
scp /etc/ceph/ceph.client.admin.keyring $dst:/etc/ceph
scp /etc/ceph/ceph.conf $dst:/etc/ceph
ssh $dst mkdir /var/lib/ceph/mon/ceph-$dst
ssh $dst ceph-mon --cluster ceph --mkfs -i $dst --monmap /tmp/monmap --keyring /tmp/ceph.mon.keyring
ssh $dst chown -R ceph:ceph /var/lib/ceph/mon/ceph-$dst
ssh $dst systemctl start ceph-mon@$dst
# Read the comment of mon.sh
# this script assumes each node has /dev/sd{b - g} data disks as osd backend
dst=$1
ssh $dst systemctl stop firewalld
ssh $dst systemctl disable firewalld
scp /etc/yum.repos.d/* $dst:/etc/yum.repos.d/
ssh $dst yum clean all
ssh $dst yum install -y ceph-osd
scp /tmp/ceph.mon.keyring $dst:/tmp/
scp /tmp/monmap $dst:/tmp/
scp /etc/ceph/ceph.client.admin.keyring $dst:/etc/ceph
scp /etc/ceph/ceph.conf $dst:/etc/ceph
scp /var/lib/ceph/bootstrap-osd/ceph.keyring $dst:/var/lib/ceph/bootstrap-osd/ceph.keyring
ssh $dst chown -R ceph:ceph /var/lib/ceph
ssh $dst for k in b c d e f g; do ceph-volume lvm create --data /dev/sd$k; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment