Skip to content

Instantly share code, notes, and snippets.

@0xHexE
Forked from kofemann/init-single-node-ceph.sh
Last active March 10, 2020 20:26
Show Gist options
  • Save 0xHexE/3db1684357ba2a5f14d9a56b204e5e77 to your computer and use it in GitHub Desktop.
Save 0xHexE/3db1684357ba2a5f14d9a56b204e5e77 to your computer and use it in GitHub Desktop.
Single node CEPH setup
#
# Enable CEPH repos as described at http://ceph.com/docs/master/install/get-packages/#rpm
# Install ceph-deploy package
#
apt update
apt install ceph-deploy -y
export DATA_DEV=vdb
export FS_TYPE=xfs
export CEPH_S_NODE=$(hostname)
export CEPH_RELEASE=octopus
#
# Attention!
# the disks DATA_DEV and DATA_DEV will be re-partitioned!
#
# if you need to install CEPH packages
ceph-deploy install --stable ${CEPH_RELEASE} ${CEPH_S_NODE}
ceph-deploy pkg --install librados-dev ${CEPH_S_NODE}
ceph-deploy new ${CEPH_S_NODE}
echo "osd crush chooseleaf type = 0" >> ceph.conf
echo "osd pool default size = 1" >> ceph.conf
ceph-deploy mon create-initial ${CEPH_S_NODE}
ceph-deploy disk --fs-type ${FS_TYPE} zap ${CEPH_S_NODE}:${DATA_DEV}
ceph-deploy osd --fs-type ${FS_TYPE} create ${CEPH_S_NODE}:${DATA_DEV}
#
# The following files can be copied to the client host to be used with librados:
#
# /etc/ceph/ceph.client.admin.keyring
# /etc/ceph/ceph.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment