Last active
July 10, 2018 07:15
-
-
Save hysios/2e271d2e681595774757c976ad5c7aea to your computer and use it in GitHub Desktop.
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
UUID=$(uuidgen) | |
OSD_SECRET=$(ceph-authtool --gen-print-key) | |
NAME=centos_$HOSTNAME | |
DEV=/dev/mapper/$NAME-data | |
ID=$(echo "{\"cephx_secret\": \"$OSD_SECRET\"}" | \ | |
ceph osd new $UUID -i - \ | |
-n client.admin -k /etc/ceph/ceph.client.admin.keyring) | |
mkdir /var/lib/ceph/osd/ceph-$ID | |
umount /data | |
mkfs.xfs -K ${DEV} -f | |
mount $DEV /var/lib/ceph/osd/ceph-$ID | |
ceph-authtool --create-keyring /var/lib/ceph/osd/ceph-$ID/keyring \ | |
--name osd.$ID --add-key $OSD_SECRET | |
ceph-osd -i $ID --mkfs --osd-uuid $UUID | |
chown -R ceph:ceph /var/lib/ceph/osd/ceph-$ID | |
systemctl enable ceph-osd@$ID | |
systemctl start ceph-osd@$ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment