]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
vstart.sh: --cache <pool> to set up pool cache(s) on startup
authorSage Weil <sage@inktank.com>
Thu, 12 Dec 2013 21:33:40 +0000 (13:33 -0800)
committerSage Weil <sage@inktank.com>
Fri, 20 Dec 2013 00:39:59 +0000 (16:39 -0800)
Signed-off-by: Sage Weil <sage@inktank.com>
src/vstart.sh

index 86f969a76d6a85887f15f0de9cf3ab7db4ed1a86..d150712352cc5fc4b534d32efde98033a2082348 100755 (executable)
@@ -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"