Last active
February 4, 2016 00:16
-
-
Save dotnwat/d0017400c12a45e403d3 to your computer and use it in GitHub Desktop.
Setup Ceph and Run RADOS Hello World
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 | |
set -x | |
set -e | |
set -u | |
CEPHDIR=$1 | |
DATA=${2:-} | |
JRNL=${3:-} | |
NODE=`hostname` | |
rm -rf cluster | |
mkdir cluster | |
pushd cluster | |
### Cleanup and install Ceph | |
############ | |
sudo service ceph-all stop || true | |
ceph-deploy purge $NODE | |
ceph-deploy purgedata $NODE | |
rm -rf $CEPHDIR | |
retries=0 | |
until [ $retries -ge 5 ]; do | |
ceph-deploy install --release infernalis $NODE && break | |
retries=$[$retries+1] | |
sleep 30 | |
done | |
retries=0 | |
until [ $retries -ge 5 ]; do | |
ceph-deploy pkg --install librados-dev $NODE && break | |
retries=$[$retries+1] | |
sleep 30 | |
done | |
ceph-deploy new $NODE | |
### Setup the configuration | |
########### | |
# use memory store if no data device provided | |
if [ -z "$DATA" ]; then | |
cat >> ceph.conf <<EOF | |
osd objectstore = memstore | |
memstore device bytes = 8589934592 | |
EOF | |
fi | |
cat >> ceph.conf <<EOF | |
osd crush chooseleaf type = 0 | |
osd pool default size = 1 | |
osd pool default min size = 1 | |
debug_lockdep = 0/0 | |
debug_context = 0/0 | |
debug_crush = 0/0 | |
debug_buffer = 0/0 | |
debug_timer = 0/0 | |
debug_filer = 0/0 | |
debug_objecter = 0/0 | |
debug_rados = 0/0 | |
debug_rbd = 0/0 | |
debug_journaler = 0/0 | |
debug_objectcatcher = 0/0 | |
debug_client = 0/0 | |
debug_osd = 0/0 | |
debug_optracker = 0/0 | |
debug_objclass = 0/0 | |
debug_filestore = 0/0 | |
debug_journal = 0/0 | |
debug_ms = 0/0 | |
debug_monc = 0/0 | |
debug_tp = 0/0 | |
debug_auth = 0/0 | |
debug_finisher = 0/0 | |
debug_heartbeatmap = 0/0 | |
debug_perfcounter = 0/0 | |
debug_asok = 0/0 | |
debug_throttle = 0/0 | |
debug_mon = 0/0 | |
debug_paxos = 0/0 | |
debug_rgw = 0/0 | |
osd_op_num_threads_per_shard = 1 //You may want to try with 1 as well | |
osd_op_num_shards = 5 //Depends on your cpu util | |
ms_nocrc = true | |
cephx_sign_messages = false | |
cephx_require_signatures = false | |
ms_dispatch_throttle_bytes = 0 | |
throttler_perf_counter = false | |
[osd] | |
osd_client_message_size_cap = 0 | |
osd_client_message_cap = 0 | |
osd_enable_op_tracker = false | |
EOF | |
### Setup monitor and keyrings | |
############ | |
ceph-deploy mon create-initial | |
ceph-deploy admin $NODE | |
sudo chmod a+r /etc/ceph/ceph.client.admin.keyring | |
### Setup OSD | |
############ | |
if [ -n "$DATA" ]; then | |
ceph-deploy disk zap $NODE:$DATA | |
if [ -n "$JRNL" ]; then | |
ceph-deploy disk zap $NODE:$JRNL | |
ceph-deploy osd create $NODE:$DATA:$JRNL | |
else | |
ceph-deploy osd create $NODE:$DATA | |
fi | |
else | |
mkdir $CEPHDIR | |
ceph-deploy osd prepare $NODE:$CEPHDIR | |
ceph-deploy osd activate $NODE:$CEPHDIR | |
fi | |
popd |
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 | |
set -x | |
set -e | |
apt-get update | |
apt-get install curl python-pip build-essential | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment