From ffdaa5f41594e5b580dbe14b0e28a2606dc44529 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Dec 2013 13:33:40 -0800 Subject: [PATCH] vstart.sh: --cache to set up pool cache(s) on startup Signed-off-by: Sage Weil --- src/vstart.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/vstart.sh b/src/vstart.sh index 86f969a76d6a..d150712352cc 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -37,6 +37,7 @@ smallmds=0 hitset="" overwrite_conf=1 cephx=1 #turn cephx on by default +cache="" MON_ADDR="" @@ -153,6 +154,14 @@ case $1 in " shift ;; + --cache ) + if [ -z "$cache" ]; then + cache="$2" + else + cache="$cache $2" + fi + shift + ;; * ) usage_exit esac @@ -578,6 +587,21 @@ EOF done fi +echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output." + +do_cache() { + while [ -n "$*" ]; do + p="$1" + shift + echo "creating cache for pool $p ..." + $SUDO $CEPH_ADM osd pool create ${p}-cache 8 + $SUDO $CEPH_ADM osd tier add $p ${p}-cache + $SUDO $CEPH_ADM osd tier cache-mode ${p}-cache writeback + $SUDO $CEPH_ADM osd tier set-overlay $p ${p}-cache + done +} +do_cache $cache + do_hitsets() { while [ -n "$*" ]; do pool="$1" @@ -592,8 +616,6 @@ do_hitsets() { } do_hitsets $hitset -echo "started. stop.sh to stop. see out/* (e.g. 'tail -f out/????') for debug output." - echo "" echo "export PYTHONPATH=./pybind" echo "export LD_LIBRARY_PATH=.libs" -- 2.47.3