Add ceilometer

Implements bug 1023972. Add mongodb and pymongo installation.

Change-Id: I631dc8a37f3269e55112ec5a5f375d3a2fd3a604
This commit is contained in:
John H. Tran 2012-07-26 11:22:05 -07:00
parent 7b0f002b7c
commit 93361643c6
6 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,2 @@
python-pymongo
mongodb-server

View File

@ -0,0 +1,2 @@
mongodb-server
pymongo

View File

@ -129,6 +129,10 @@ function get_packages() {
if [[ ! $file_to_parse =~ cinder ]]; then
file_to_parse="${file_to_parse} cinder"
fi
elif [[ $service == ceilometer-* ]]; then
if [[ ! $file_to_parse =~ ceilometer ]]; then
file_to_parse="${file_to_parse} ceilometer"
fi
elif [[ $service == n-* ]]; then
if [[ ! $file_to_parse =~ nova ]]; then
file_to_parse="${file_to_parse} nova"
@ -375,6 +379,7 @@ function is_service_enabled() {
[[ ,${ENABLED_SERVICES}, =~ ,${service}, ]] && return 0
[[ ${service} == "nova" && ${ENABLED_SERVICES} =~ "n-" ]] && return 0
[[ ${service} == "cinder" && ${ENABLED_SERVICES} =~ "c-" ]] && return 0
[[ ${service} == "ceilometer" && ${ENABLED_SERVICES} =~ "ceilometer-" ]] && return 0
[[ ${service} == "glance" && ${ENABLED_SERVICES} =~ "g-" ]] && return 0
[[ ${service} == "quantum" && ${ENABLED_SERVICES} =~ "q-" ]] && return 0
done

60
lib/ceilometer Normal file
View File

@ -0,0 +1,60 @@
# lib/ceilometer
# Install and start Ceilometer service
# Dependencies:
# - functions
# stack.sh
# ---------
# install_XXX
# configure_XXX
# init_XXX
# start_XXX
# stop_XXX
# cleanup_XXX
# Print the commands being run so that we can see the command that triggers
# an error. It is also useful for following along as the install occurs.
set -o xtrace
# Defaults
# --------
# set up default directories
CEILOMETER_DIR=$DEST/ceilometer
CEILOMETER_CONF_DIR=/etc/ceilometer
CEILOMETER_AGENT_CONF=$CEILOMETER_CONF_DIR/ceilometer-agent.conf
CEILOMETER_COLLECTOR_CONF=$CEILOMETER_CONF_DIR/ceilometer-collector.conf
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_ceilometer() {
# This function intentionally left blank
:
}
# configure_ceilometer() - Set config files, create data dirs, etc
function configure_ceilometer() {
setup_develop $CEILOMETER_DIR
if [ ! -d $CEILOMETER_CONF_DIR ]; then
sudo mkdir -m 755 -p $CEILOMETER_CONF_DIR
fi
sudo chown `whoami` $CEILOMETER_CONF_DIR
# ceilometer confs are copy of /etc/nova/nova.conf which must exist first
grep -v format_string $NOVA_CONF_DIR/$NOVA_CONF > $CEILOMETER_AGENT_CONF
grep -v format_string $NOVA_CONF_DIR/$NOVA_CONF > $CEILOMETER_COLLECTOR_CONF
}
# install_ceilometer() - Collect source and prepare
function install_ceilometer() {
git_clone $CEILOMETER_REPO $CEILOMETER_DIR $CEILOMETER_BRANCH
}
# start_ceilometer() - Start running processes, including screen
function start_ceilometer() {
screen_it ceilometer-acompute "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-agent-compute --config-file $CEILOMETER_AGENT_CONF"
screen_it ceilometer-acentral "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-agent-central --config-file $CEILOMETER_AGENT_CONF"
screen_it ceilometer-collector "cd $CEILOMETER_DIR && $CEILOMETER_DIR/bin/ceilometer-collector --config-file $CEILOMETER_COLLECTOR_CONF"
}

View File

@ -240,6 +240,7 @@ sudo chown `whoami` $DATA_DIR
# Get project function libraries
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/ceilometer
# Set the destination directories for openstack projects
NOVA_DIR=$DEST/nova
@ -789,6 +790,9 @@ fi
if is_service_enabled cinder; then
install_cinder
fi
if is_service_enabled ceilometer; then
install_ceilometer
fi
# Initialization
# ==============
@ -2122,6 +2126,10 @@ screen_it n-cauth "cd $NOVA_DIR && ./bin/nova-consoleauth"
if is_service_enabled cinder; then
start_cinder
fi
if is_service_enabled ceilometer; then
configure_ceilometer
start_ceilometer
fi
screen_it horizon "cd $HORIZON_DIR && sudo tail -f /var/log/$APACHE_NAME/horizon_error.log"
screen_it swift "cd $SWIFT_DIR && $SWIFT_DIR/bin/swift-proxy-server ${SWIFT_CONFIG_DIR}/proxy-server.conf -v"

View File

@ -24,6 +24,10 @@ NOVA_ENABLED_APIS=ec2,osapi_compute,osapi_volume,metadata
# Another option is http://review.openstack.org/p
GIT_BASE=https://github.com
# metering service
CEILOMETER_REPO=https://github.com/stackforge/ceilometer.git
CEILOMETER_BRANCH=master
# volume service
CINDER_REPO=${GIT_BASE}/openstack/cinder
CINDER_BRANCH=master