Browse code

Add ceilometer

Implements bug 1023972. Add mongodb and pymongo installation.

Change-Id: I631dc8a37f3269e55112ec5a5f375d3a2fd3a604

John H. Tran authored on 2012/07/27 03:22:05
Showing 6 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+python-pymongo
1
+mongodb-server
0 2
new file mode 100644
... ...
@@ -0,0 +1,2 @@
0
+mongodb-server
1
+pymongo
... ...
@@ -129,6 +129,10 @@ function get_packages() {
129 129
             if [[ ! $file_to_parse =~ cinder ]]; then
130 130
                 file_to_parse="${file_to_parse} cinder"
131 131
             fi
132
+        elif [[ $service == ceilometer-* ]]; then
133
+            if [[ ! $file_to_parse =~ ceilometer ]]; then
134
+                file_to_parse="${file_to_parse} ceilometer"
135
+            fi
132 136
         elif [[ $service == n-* ]]; then
133 137
             if [[ ! $file_to_parse =~ nova ]]; then
134 138
                 file_to_parse="${file_to_parse} nova"
... ...
@@ -375,6 +379,7 @@ function is_service_enabled() {
375 375
         [[ ,${ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
376 376
         [[ ${service} == "nova" && ${ENABLED_SERVICES} =~ "n-" ]] && return 0
377 377
         [[ ${service} == "cinder" && ${ENABLED_SERVICES} =~ "c-" ]] && return 0
378
+        [[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && return 0
378 379
         [[ ${service} == "glance" && ${ENABLED_SERVICES} =~ "g-" ]] && return 0
379 380
         [[ ${service} == "quantum" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0
380 381
     done
381 382
new file mode 100644
... ...
@@ -0,0 +1,60 @@
0
+# lib/ceilometer
1
+# Install and start Ceilometer service
2
+
3
+# Dependencies:
4
+# - functions
5
+
6
+# stack.sh
7
+# ---------
8
+# install_XXX
9
+# configure_XXX
10
+# init_XXX
11
+# start_XXX
12
+# stop_XXX
13
+# cleanup_XXX
14
+
15
+# Print the commands being run so that we can see the command that triggers
16
+# an error.  It is also useful for following along as the install occurs.
17
+set -o xtrace
18
+
19
+
20
+# Defaults
21
+# --------
22
+
23
+# set up default directories
24
+CEILOMETER_DIR=$DEST/ceilometer
25
+CEILOMETER_CONF_DIR=/etc/ceilometer
26
+CEILOMETER_AGENT_CONF=$CEILOMETER_CONF_DIR/ceilometer-agent.conf
27
+CEILOMETER_COLLECTOR_CONF=$CEILOMETER_CONF_DIR/ceilometer-collector.conf
28
+
29
+# cleanup_ceilometer() - Remove residual data files, anything left over from previous
30
+# runs that a clean run would need to clean up
31
+function cleanup_ceilometer() {
32
+    # This function intentionally left blank
33
+    :
34
+}
35
+
36
+# configure_ceilometer() - Set config files, create data dirs, etc
37
+function configure_ceilometer() {
38
+    setup_develop $CEILOMETER_DIR
39
+    if [ ! -d $CEILOMETER_CONF_DIR ]; then
40
+        sudo mkdir -m 755 -p $CEILOMETER_CONF_DIR
41
+    fi
42
+    sudo chown `whoami` $CEILOMETER_CONF_DIR
43
+
44
+    # ceilometer confs are copy of /etc/nova/nova.conf which must exist first
45
+    grep -v format_string $NOVA_CONF_DIR/$NOVA_CONF > $CEILOMETER_AGENT_CONF
46
+    grep -v format_string $NOVA_CONF_DIR/$NOVA_CONF > $CEILOMETER_COLLECTOR_CONF
47
+}
48
+
49
+# install_ceilometer() - Collect source and prepare
50
+function install_ceilometer() {
51
+    git_clone $CEILOMETER_REPO $CEILOMETER_DIR $CEILOMETER_BRANCH
52
+}
53
+
54
+# start_ceilometer() - Start running processes, including screen
55
+function start_ceilometer() {
56
+    screen_it ceilometer-acompute "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-agent-compute --config-file $CEILOMETER_AGENT_CONF"
57
+    screen_it ceilometer-acentral "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-agent-central --config-file $CEILOMETER_AGENT_CONF"
58
+    screen_it ceilometer-collector "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-collector --config-file $CEILOMETER_COLLECTOR_CONF"
59
+}
... ...
@@ -240,6 +240,7 @@ sudo chown `whoami` $DATA_DIR
240 240
 
241 241
 # Get project function libraries
242 242
 source $TOP_DIR/lib/cinder
243
+source $TOP_DIR/lib/ceilometer
243 244
 
244 245
 # Set the destination directories for openstack projects
245 246
 NOVA_DIR=$DEST/nova
... ...
@@ -789,6 +790,9 @@ fi
789 789
 if is_service_enabled cinder; then
790 790
     install_cinder
791 791
 fi
792
+if is_service_enabled ceilometer; then
793
+    install_ceilometer
794
+fi
792 795
 
793 796
 # Initialization
794 797
 # ==============
... ...
@@ -2122,6 +2126,10 @@ screen_it n-cauth "cd $NOVA_DIR && ./bin/nova-consoleauth"
2122 2122
 if is_service_enabled cinder; then
2123 2123
     start_cinder
2124 2124
 fi
2125
+if is_service_enabled ceilometer; then
2126
+    configure_ceilometer
2127
+    start_ceilometer
2128
+fi
2125 2129
 screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/$APACHE_NAME/horizon_error.log"
2126 2130
 screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v"
2127 2131
 
... ...
@@ -24,6 +24,10 @@ NOVA_ENABLED_APIS=ec2,osapi_compute,osapi_volume,metadata
24 24
 # Another option is http://review.openstack.org/p
25 25
 GIT_BASE=https://github.com
26 26
 
27
+# metering service
28
+CEILOMETER_REPO=https://github.com/stackforge/ceilometer.git
29
+CEILOMETER_BRANCH=master
30
+
27 31
 # volume service
28 32
 CINDER_REPO=${GIT_BASE}/openstack/cinder
29 33
 CINDER_BRANCH=master