debian: Further improve the usage server package

We no longer symlink db.properties to the management server, but
we create a own db.properties for the usage server.

During a upgrade we copy the file to make the upgrade easier.
This commit is contained in:
Wido den Hollander 2013-03-13 20:25:49 +01:00
parent 97d2e3fe77
commit cd65d26a93
3 changed files with 49 additions and 1 deletions

37
debian/cloudstack-usage.postinst vendored Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -e
case "$1" in
configure)
# We copy the db.properties file from the management server to the usage server
# This used to be a symlink, but we don't do that anymore
if [ -f "/etc/cloud/management/db.properties" ]; then
cp -a /etc/cloud/management/db.properties /etc/cloudstack/usage/db.properties
fi
# We also retain the log4j configuration
if [ -f "/etc/cloud/usage/log4j-cloud_usage.xml" ]; then
cp -a /etc/cloud/usage/log4j-cloud_usage.xml /etc/cloudstack/usage/log4j-cloud_usage.xml
fi
;;
esac
exit 0

1
debian/rules vendored
View File

@ -129,7 +129,6 @@ install:
install -D usage/target/cloud-usage-$(VERSION)-SNAPSHOT.jar $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/$(PACKAGE)-usage.jar
install -D usage/target/dependencies/* $(DESTDIR)/usr/share/$(PACKAGE)-usage/lib/
cp usage/target/transformed/* $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/
ln -s ../management/db.properties $(DESTDIR)/$(SYSCONFDIR)/$(PACKAGE)/usage/db.properties
install -D packaging/debian/init/cloud-usage $(DESTDIR)/$(SYSCONFDIR)/init.d/$(PACKAGE)-usage
# cloudstack-awsapi

View File

@ -0,0 +1,12 @@
# usage database settings
db.usage.username=@DBUSER@
db.usage.password=@DBPW@
db.usage.host=@DBHOST@
db.usage.port=3306
db.usage.name=cloud_usage
# usage database tuning parameters
db.usage.maxActive=100
db.usage.maxIdle=30
db.usage.maxWait=10000
db.usage.autoReconnect=true