Browse code

Allow ceilometer to use redis for coordination

If redis is desired by local.conf via CEILOMETER_COORDINATION_URL
then make sure redis is installed and restarted.

Change-Id: Idfb7b902478049fbc240bf416db6c7d6acd67a51

Chris Dent authored on 2014/10/22 04:19:23
Showing 1 changed files
... ...
@@ -242,6 +242,18 @@ function init_ceilometer {
242 242
     fi
243 243
 }
244 244
 
245
+# install_redis() - Install the redis server.
246
+function install_redis {
247
+    if is_ubuntu; then
248
+        install_package redis-server
249
+    else
250
+        # This will fail (correctly) where a redis package is unavailable
251
+        install_package redis
252
+    fi
253
+
254
+    restart_service redis
255
+}
256
+
245 257
 # install_ceilometer() - Collect source and prepare
246 258
 function install_ceilometer {
247 259
     git_clone $CEILOMETER_REPO $CEILOMETER_DIR $CEILOMETER_BRANCH
... ...
@@ -249,6 +261,8 @@ function install_ceilometer {
249 249
 
250 250
     if echo $CEILOMETER_COORDINATION_URL | grep -q '^memcached:'; then
251 251
         install_package memcached
252
+    elif echo $CEILOMETER_COORDINATION_URL | grep -q '^redis:'; then
253
+        install_redis
252 254
     fi
253 255
 }
254 256