summaryrefslogtreecommitdiffstats
path: root/sca-cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:28 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2012-05-28 04:39:28 +0000
commit4a28afdf7a6b193942f180862d443a7d818c5789 (patch)
treedd1afbf7757a075f768af1b4e588e5dabc2a5f71 /sca-cpp
parentf278315081b24b59bf73e9613e552e3519200a71 (diff)
Database support optimizations. Use PgBouncer to pool connections. Track and manage WAL archives to optimize space and speed up database replication setup.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343139 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp')
-rw-r--r--sca-cpp/trunk/INSTALL4
-rw-r--r--sca-cpp/trunk/README2
-rw-r--r--sca-cpp/trunk/components/sqldb/Makefile.am6
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql2
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-archive59
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-backup38
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-clean-archive58
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-conf60
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-restore30
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-standby-conf66
-rw-r--r--sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp8
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-start5
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-stop7
-rw-r--r--sca-cpp/trunk/components/sqldb/pgsql-test.cpp4
-rw-r--r--sca-cpp/trunk/components/sqldb/pgsql.hpp103
-rw-r--r--sca-cpp/trunk/components/sqldb/sqldb.componentType2
-rw-r--r--sca-cpp/trunk/components/sqldb/sqldb.composite2
-rw-r--r--sca-cpp/trunk/configure.ac28
-rwxr-xr-xsca-cpp/trunk/macos/macos-install19
-rw-r--r--sca-cpp/trunk/samples/store-cluster/shared/shared.composite4
-rw-r--r--sca-cpp/trunk/samples/store-sql/store.composite2
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-backup4
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-backup-all4
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-install23
-rwxr-xr-xsca-cpp/trunk/ubuntu/ubuntu-install-all21
25 files changed, 434 insertions, 127 deletions
diff --git a/sca-cpp/trunk/INSTALL b/sca-cpp/trunk/INSTALL
index 97cc13e156..50ae0f30b3 100644
--- a/sca-cpp/trunk/INSTALL
+++ b/sca-cpp/trunk/INSTALL
@@ -149,6 +149,7 @@ Google LevelDB 1.2 (http://code.google.com/p/leveldb/)
SQL database:
PostgreSQL 9.1.2 (http://www.postgresql.org/)
+PgBouncer 1.5 (http://wiki.postgresql.org/wiki/PgBouncer)
Logging:
Facebook Scribe 2.2 (http://github.com/facebook/scribe/downloads)
@@ -197,7 +198,7 @@ Vysper if you want to run the tests with a local Vysper XMPP server):
To build the Log utility component (requires Facebook Scribe and Apache Thrift):
--enable-log
-To build the SQL Database utility component (requires PostgreSQL):
+To build the SQL Database utility component (requires PostgreSQL and PgBouncer):
--enable-sqldb
To build the Web service utility component (requires Apache Axis2/C):
@@ -247,6 +248,7 @@ dependencies installed under $build:
--enable-chat --with-libstrophe=$build/libstrophe-bin \
--with-vysper=$build/vysper-0.5 \
--enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin \
+--with-pgbouncer=$build/pgbouncer-1.5-bin \
--enable-log --with-thrift=$build/thrift-0.2.0-bin \
--with-scribe=$build/scribe-2.2-bin \
--enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin \
diff --git a/sca-cpp/trunk/README b/sca-cpp/trunk/README
index ce13557a1e..c5139fd679 100644
--- a/sca-cpp/trunk/README
+++ b/sca-cpp/trunk/README
@@ -21,7 +21,7 @@ Smtp: SMTP client, using Libcurl;
Kvdb: fast key/value persistent store, using LevelDB;
Log: distributed logger, using Facebook Scribe;
Queue: AMQP queuing, using Apache Qpid/C;
-Sqldb: SQL database, using PostgreSQL;
+Sqldb: SQL database, using PostgreSQL and PgBouncer;
Webservice: Web service gateway, using Apache Axis2/C.
These components present a simple ATOMPub REST interface, allowing you to send
diff --git a/sca-cpp/trunk/components/sqldb/Makefile.am b/sca-cpp/trunk/components/sqldb/Makefile.am
index 0443de07d9..9ce5f26713 100644
--- a/sca-cpp/trunk/components/sqldb/Makefile.am
+++ b/sca-cpp/trunk/components/sqldb/Makefile.am
@@ -22,12 +22,14 @@ INCLUDES = -I${PGSQL_INCLUDE}
incl_HEADERS = *.hpp
incldir = $(prefix)/include/components/sqldb
-dist_comp_SCRIPTS = pgsql-conf pgsql-log-conf pgsql-start pgsql-stop pgsql pgsql-standby-conf pgsql-backup
+dist_comp_SCRIPTS = pgsql-conf pgsql-log-conf pgsql-start pgsql-stop pgsql pgsql-standby-conf pgsql-archive pgsql-backup pgsql-restore pgsql-clean-archive
compdir=$(prefix)/components/sqldb
-comp_DATA = pgsql.prefix
+comp_DATA = pgsql.prefix pgbouncer.prefix
pgsql.prefix: $(top_builddir)/config.status
echo ${PGSQL_PREFIX} >pgsql.prefix
+pgbouncer.prefix: $(top_builddir)/config.status
+ echo ${PGBOUNCER_PREFIX} >pgbouncer.prefix
EXTRA_DIST = sqldb.composite sqldb.componentType
diff --git a/sca-cpp/trunk/components/sqldb/pgsql b/sca-cpp/trunk/components/sqldb/pgsql
index 8079fde7b1..8a60068ab7 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql
+++ b/sca-cpp/trunk/components/sqldb/pgsql
@@ -23,7 +23,7 @@ pgsql_prefix=`cat $here/pgsql.prefix`
if [ "$2" = "" ]; then
host="localhost"
- port="5432"
+ port="6432"
cmd="$1"
else
host="$1"
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-archive b/sca-cpp/trunk/components/sqldb/pgsql-archive
new file mode 100755
index 0000000000..128e6eb539
--- /dev/null
+++ b/sca-cpp/trunk/components/sqldb/pgsql-archive
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+# 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.
+
+# PostgreSQL archive command
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
+
+host=$2
+port=$3
+walp=$4
+walf=$5
+
+# Copy WAL to archive directory
+if [ ! -f $root/sqldb/archive/$walf ]; then
+ cp $walp $root/sqldb/archive/$walf
+ rc=$?
+ if [ "$rc" != "0" ]; then
+ exit $rc
+ fi
+fi
+
+# Trigger a backup if we have 10 WAL files archived since the last backup
+lastbak=`ls $root/sqldb/archive | sort -r | grep "\.backup$" | head -1`
+if [ "$lastbak" = "" ]; then
+ exit 0
+fi
+wals=`ls $root/sqldb/archive | sort -r | grep -v "\.backup\.tar\.gz$"`
+
+w=0
+for f in $wals; do
+ if [ "$f" = "$lastbak" ]; then
+ break
+ fi
+ w=$((w+1))
+
+ if [ "$w" = "10" ]; then
+ nohup /bin/sh -c "$here/pgsql-backup $root $host $port" 1>/dev/null 2>/dev/null &
+ break
+ fi
+done
+
+exit 0
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-backup b/sca-cpp/trunk/components/sqldb/pgsql-backup
index c0b1c4b2aa..ff660ad20d 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-backup
+++ b/sca-cpp/trunk/components/sqldb/pgsql-backup
@@ -23,7 +23,7 @@ root=`echo "import os; print os.path.realpath('$1')" | python`
if [ "$2" = "" ]; then
host="localhost"
- port="5432"
+ port="6432"
else
host="$2"
port="$3"
@@ -40,12 +40,40 @@ fi
mkdir -p $root/sqldb
echo $pgsql_log >$root/sqldb/logger
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 2>&1 | sh $root/sqldb/logger
+mkdir -p $root/sqldb/backup
+mkdir -p $root/sqldb/archive
-echo "Content-type: application/x-compressed"
-echo
+# Make sure that only one backup is in progress at a time
+if [ -f $root/sqldb/backup/inprogress ]; then
+ exit 0
+fi
+touch $root/sqldb/backup/inprogress
+
+# Backup
+stamp=`date +%Y%m%d%H%M%S`
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('$stamp', true)" db 2>&1 | sh $root/sqldb/logger
-tar -C $root/sqldb -cz data
+uname=`uname -s`
+if [ $uname = "Darwin" ]; then
+ tar=gnutar
+else
+ tar=tar
+fi
+$tar -C $root/sqldb --exclude data/postmaster.pid --exclude data/postmaster.opts --exclude data/pg_xlog --ignore-failed-read -czf $root/sqldb/backup/$stamp.backup.tar.gz data
+rc=$?
+if [ "$rc" = "0" ]; then
+ mv $root/sqldb/backup/$stamp.backup.tar.gz $root/sqldb/archive/$stamp.backup.tar.gz
+fi
$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 2>&1 | sh $root/sqldb/logger
+if [ "$rc" != "0" ]; then
+ rm -f $root/sqldb/backup/inprogress
+ exit $rc
+fi
+
+# Clean obsolete backup and WAL files
+$here/pgsql-clean-archive $root
+
+rm -f $root/sqldb/backup/inprogress
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-clean-archive b/sca-cpp/trunk/components/sqldb/pgsql-clean-archive
new file mode 100755
index 0000000000..0e52fade89
--- /dev/null
+++ b/sca-cpp/trunk/components/sqldb/pgsql-clean-archive
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# 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.
+
+# Cleanup database archive.
+# Keep the last two backups and corresponding WAL files.
+
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
+
+baks=`ls $root/sqldb/archive | sort -r | grep "\.backup$" | head -2`
+wals=`ls $root/sqldb/archive | sort -r | grep -v "\.backup\.tar\.gz$"`
+tars=`ls $root/sqldb/archive | sort -r | grep "\.backup\.tar\.gz$"`
+
+for f in $baks; do
+ if [ "$lastbak" = "" ]; then
+ lastbak=$f
+ else
+ prevbak=$f
+ fi
+done
+
+w=0
+for f in $wals; do
+ if [ "$w" = "2" ]; then
+ rm $root/sqldb/archive/$f
+ fi
+ if [ "$w" = "1" ]; then
+ w=2
+ fi
+ if [ "$f" = "$prevbak" ]; then
+ w=1
+ fi
+done
+
+t=0
+for f in $tars; do
+ if [ "$t" = "2" ]; then
+ rm $root/sqldb/archive/$f
+ fi
+ t=$((t+1))
+done
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-conf b/sca-cpp/trunk/components/sqldb/pgsql-conf
index 58d38412ca..482048a295 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-conf
+++ b/sca-cpp/trunk/components/sqldb/pgsql-conf
@@ -33,11 +33,15 @@ else
fi
port=`$here/../../modules/http/httpd-addr port $addr`
fi
+bport=`expr $port + 1000`
pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
+
mkdir -p $root/sqldb/data
chmod 700 $root/sqldb/data
mkdir -p $root/sqldb/archive
+mkdir -p $root/sqldb/backup
if [ -f "$root/sqldb/log.conf" ]; then
pgsql_log=`cat $root/sqldb/log.conf`
@@ -48,6 +52,7 @@ fi
mkdir -p $root/sqldb
echo $pgsql_log >$root/sqldb/logger
+# Initialize PostgreSQL
if [ ! -f $root/sqldb/data/postgresql.conf ]; then
$pgsql_prefix/bin/pg_ctl init -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
cp $root/sqldb/data/postgresql.conf $root/sqldb/data/postgresql-init.conf
@@ -77,7 +82,7 @@ port = $port
# Setup archival
archive_mode = on
-archive_command = 'cp %p $root/sqldb/archive/%f'
+archive_command = '$here/pgsql-archive $root localhost $bport %p %f'
# Setup hot standby with streaming replication
wal_level = hot_standby
@@ -97,7 +102,7 @@ host replication all samenet trust
EOF
-# Create the db
+# Create the db if it's not created yet
nohup /bin/sh -c "($pgsql_prefix/bin/pg_ctl start -W -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger)" 1>/dev/null 2>/dev/null &
sti=0
while [ $sti -ne 30 ]; do
@@ -110,15 +115,22 @@ while [ $sti -ne 30 ]; do
done
$pgsql_prefix/bin/createdb -h localhost -p $port db 2>&1 | sh $root/sqldb/logger
+
+# Backup the db if there's no backup for it yet
+baks=`ls $root/sqldb/archive | sort -r | grep "\.backup\.tar\.gz$"`
+if [ "$baks" = "" ]; then
+ $here/pgsql-backup $root localhost $port
+fi
+
$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
-# Generate database backup script
+# Generate database restore script
mkdir -p $root/sqldb/scripts
-cat >$root/sqldb/scripts/backup <<EOF
+cat >$root/sqldb/scripts/restore <<EOF
#!/bin/sh
-$here/pgsql-backup $root localhost $port
+$here/pgsql-restore $root
EOF
-chmod 700 $root/sqldb/scripts/backup
+chmod 700 $root/sqldb/scripts/restore
# Configure HTTPD to serve backup and archive files
if [ -f "$root/conf/httpd.conf" ]; then
@@ -126,10 +138,44 @@ if [ -f "$root/conf/httpd.conf" ]; then
# Generated by: pgsql-conf $*
# Serve PostgreSQL backup and WAL archive files
-ScriptAlias /pgsql-backup "$root/sqldb/scripts/backup"
+ScriptAlias /pgsql-restore "$root/sqldb/scripts/restore"
Alias /pgsql-archive "$root/sqldb/archive"
EOF
fi
+# Configure PgBouncer
+mkdir -p $root/logs
+id=`id -un`
+cat >$root/sqldb/data/pgbouncer.conf <<EOF
+
+[databases]
+db = host=localhost dbname=db
+
+[pgbouncer]
+pool_mode = session
+listen_port = $bport
+listen_addr = $ip
+auth_type = trust
+auth_file=$root/sqldb/data/pgbouncer-auth.conf
+logfile = $root/logs/pgbouncer
+pidfile = $root/logs/pgbouncer.pid
+max_client_conn = 1000
+pool_mode = transaction
+server_reset_query =
+default_pool_size = 500
+min_pool_size = 5
+reserve_pool_size = 50
+log_connections = 0
+log_disconnections = 0
+stats_period = 3600
+admin_users = $id
+
+EOF
+
+cat >$root/sqldb/data/pgbouncer-auth.conf <<EOF
+"$id" "password"
+
+EOF
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-restore b/sca-cpp/trunk/components/sqldb/pgsql-restore
new file mode 100755
index 0000000000..e91eba2a6b
--- /dev/null
+++ b/sca-cpp/trunk/components/sqldb/pgsql-restore
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# 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.
+
+# Backup postgresql data directory
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here`
+root=`echo "import os; print os.path.realpath('$1')" | python`
+
+tar=`ls $root/sqldb/archive | sort -r | grep "\.backup\.tar\.gz$" | head -1`
+
+echo "Content-type: application/x-compressed"
+echo ""
+
+cat $root/sqldb/archive/$tar
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-standby-conf b/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
index bc0d4e9981..77d1dfa8e2 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
+++ b/sca-cpp/trunk/components/sqldb/pgsql-standby-conf
@@ -34,6 +34,7 @@ else
fi
port=`$here/../../modules/http/httpd-addr port $addr`
fi
+bport=`expr $port + 1000`
# Master server address
if [ "$3" = "" ]; then
@@ -47,6 +48,12 @@ else
fi
pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
+
+mkdir -p $root/sqldb/data
+chmod 700 $root/sqldb/data
+mkdir -p $root/sqldb/archive
+mkdir -p $root/sqldb/backup
if [ -f "$root/sqldb/log.conf" ]; then
pgsql_log=`cat $root/sqldb/log.conf`
@@ -57,14 +64,15 @@ fi
mkdir -p $root/sqldb
echo $pgsql_log >$root/sqldb/logger
-mkdir -p $root/sqldb/data
-chmod 700 $root/sqldb/data
-mkdir -p $root/sqldb/archive
-
# Initialize from a backup of the master
if [ ! -f $root/sqldb/data/postgresql.conf ]; then
- (curl -L -# http://$mhost:$mhttpport/pgsql-backup | tar -C $root/sqldb -xz) 2>&1 | grep -v "100.0%" | sh $root/sqldb/logger
- rm -rf $root/sqldb/data/postmaster.pid $root/sqldb/data/pg_xlog
+ uname=`uname -s`
+ if [ $uname = "Darwin" ]; then
+ tar=gnutar
+ else
+ tar=tar
+ fi
+ (curl -L -# http://$mhost:$mhttpport/pgsql-restore | $tar -C $root/sqldb -xz) 2>&1 | grep -v "100.0%" | sh $root/sqldb/logger
mkdir -p $root/sqldb/data/pg_xlog/archive_status
chmod 700 $root/sqldb/data/pg_xlog/archive_status
fi
@@ -92,7 +100,7 @@ port = $port
# Setup archival
archive_mode = on
-archive_command = 'cp %p $root/sqldb/archive/%f'
+archive_command = '$here/pgsql-archive $root localhost $bport %p %f'
# Setup hot standby with streaming replication
wal_level = hot_standby
@@ -119,13 +127,13 @@ restore_command = 'curl -L -# http://$mhost:$mhttpport/pgsql-archive/%f -o "%p"
EOF
-# Generate database backup script
+# Generate database restore script
mkdir -p $root/sqldb/scripts
-cat >$root/sqldb/scripts/backup <<EOF
+cat >$root/sqldb/scripts/restore <<EOF
#!/bin/sh
-$here/pgsql-backup $root localhost $port
+$here/pgsql-restore $root
EOF
-chmod 700 $root/sqldb/scripts/backup
+chmod 700 $root/sqldb/scripts/restore
# Configure HTTPD to serve backup and archive files
if [ -f "$root/conf/httpd.conf" ]; then
@@ -133,10 +141,44 @@ if [ -f "$root/conf/httpd.conf" ]; then
# Generated by: pgsql-standby-conf $*
# Serve PostgreSQL backup and WAL archive files
-ScriptAlias /pgsql-backup "$root/sqldb/scripts/backup"
+ScriptAlias /pgsql-restore "$root/sqldb/scripts/restore"
Alias /pgsql-archive "$root/sqldb/archive"
EOF
fi
+# Configure PgBouncer
+mkdir -p $root/logs
+id=`id -un`
+cat >$root/sqldb/data/pgbouncer.conf <<EOF
+
+[databases]
+db = host=localhost dbname=db
+
+[pgbouncer]
+pool_mode = session
+listen_port = $bport
+listen_addr = $ip
+auth_type = trust
+auth_file=$root/sqldb/data/pgbouncer-auth.conf
+logfile = $root/logs/pgbouncer
+pidfile = $root/logs/pgbouncer.pid
+max_client_conn = 1000
+pool_mode = transaction
+server_reset_query =
+default_pool_size = 500
+min_pool_size = 5
+reserve_pool_size = 50
+log_connections = 0
+log_disconnections = 0
+stats_period = 3600
+admin_users = $id
+
+EOF
+
+cat >$root/sqldb/data/pgbouncer-auth.conf <<EOF
+"$id" "password"
+
+EOF
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp b/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp
index 44f0a4a9e6..2cd25f874a 100644
--- a/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp
+++ b/sca-cpp/trunk/components/sqldb/pgsql-standby-test.cpp
@@ -33,8 +33,8 @@ namespace tuscany {
namespace pgsql {
bool testPGSql() {
- PGSql wpg("host=localhost port=5432 dbname=db", "test");
- PGSql rpg("host=localhost port=5433 dbname=db", "test");
+ PGSql wpg("host=localhost port=6432 dbname=db", "test");
+ PGSql rpg("host=localhost port=6433 dbname=db", "test");
const value k = mklist<value>("a");
assert(hasContent(post(k, string("AAA"), wpg)));
@@ -63,8 +63,8 @@ struct getLoop {
bool testGetPerf() {
const value k = mklist<value>("c");
- PGSql wpg("host=localhost port=5432 dbname=db", "test");
- PGSql rpg("host=localhost port=5433 dbname=db", "test");
+ PGSql wpg("host=localhost port=6432 dbname=db", "test");
+ PGSql rpg("host=localhost port=6433 dbname=db", "test");
assert(hasContent(post(k, string("CCC"), wpg)));
sleep(1);
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-start b/sca-cpp/trunk/components/sqldb/pgsql-start
index 2955bec991..6b388d29f0 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-start
+++ b/sca-cpp/trunk/components/sqldb/pgsql-start
@@ -22,6 +22,7 @@ here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $h
root=`echo "import os; print os.path.realpath('$1')" | python`
pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
if [ -f "$root/sqldb/log.conf" ]; then
pgsql_log=`cat $root/sqldb/log.conf`
@@ -43,3 +44,7 @@ while [ $sti -ne 30 ]; do
sti=$((sti+1))
done
+# Start PgBouncer
+mkdir -p $root/logs
+$pgbouncer_prefix/bin/pgbouncer -q -d $root/sqldb/data/pgbouncer.conf
+
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-stop b/sca-cpp/trunk/components/sqldb/pgsql-stop
index fbb9997961..16b6506838 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-stop
+++ b/sca-cpp/trunk/components/sqldb/pgsql-stop
@@ -22,6 +22,7 @@ here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $h
root=`echo "import os; print os.path.realpath('$1')" | python`
pgsql_prefix=`cat $here/pgsql.prefix`
+pgbouncer_prefix=`cat $here/pgbouncer.prefix`
if [ -f "$root/sqldb/log.conf" ]; then
pgsql_log=`cat $root/sqldb/log.conf`
@@ -32,5 +33,11 @@ fi
mkdir -p $root/sqldb
echo $pgsql_log >$root/sqldb/logger
+pgb="$pgbouncer_prefix/bin/pgbouncer -q -d $root/sqldb/data/pgbouncer.conf"
+k=`ps -ef | grep -v grep | grep "${pgb}" | awk '{ print $2 }'`
+if [ "$k" != "" ]; then
+ kill $k
+fi
+
$pgsql_prefix/bin/pg_ctl stop -w -D $root/sqldb/data 2>&1 | sh $root/sqldb/logger
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-test.cpp b/sca-cpp/trunk/components/sqldb/pgsql-test.cpp
index 1019667285..d10ab5f4c2 100644
--- a/sca-cpp/trunk/components/sqldb/pgsql-test.cpp
+++ b/sca-cpp/trunk/components/sqldb/pgsql-test.cpp
@@ -33,7 +33,7 @@ namespace tuscany {
namespace pgsql {
bool testPGSql() {
- PGSql pg("host=localhost port=5432 dbname=db", "test");
+ PGSql pg("host=localhost port=6432 dbname=db", "test");
const value k = mklist<value>("a");
assert(hasContent(post(k, string("AAA"), pg)));
@@ -59,7 +59,7 @@ struct getLoop {
bool testGetPerf() {
const value k = mklist<value>("c");
- PGSql pg("host=localhost port=5432 dbname=db", "test");
+ PGSql pg("host=localhost port=6432 dbname=db", "test");
assert(hasContent(post(k, string("CCC"), pg)));
const lambda<bool()> gl = getLoop(k, pg);
diff --git a/sca-cpp/trunk/components/sqldb/pgsql.hpp b/sca-cpp/trunk/components/sqldb/pgsql.hpp
index 74d638f370..d38af54c97 100644
--- a/sca-cpp/trunk/components/sqldb/pgsql.hpp
+++ b/sca-cpp/trunk/components/sqldb/pgsql.hpp
@@ -61,12 +61,30 @@ public:
PGSql(const string& conninfo, const string& table) : owner(true), conn(NULL), conninfo(conninfo), table(table) {
debug(conninfo, "pgsql::pgsql::conninfo");
debug(table, "pgsql::pgsql::table");
+
+ // Connect to the database
conn = PQconnectdb(c_str(conninfo));
if (PQstatus(conn) != CONNECTION_OK) {
mkfailure<bool>(string("Couldn't connect to postgresql database: ") + PQerrorMessage(conn));
return;
}
- setup(true);
+
+ // Find the name of the first column in the target table
+ // Assume that's the key we need to use
+ string ks = string("select a.attname from pg_attribute a, pg_class c where a.attrelid = c.relfilenode and c.relname = '") + table + string("' and a.attnum in (1, 2) order by a.attnum;");
+ PGresult* kr = PQexec(conn, c_str(ks));
+ if (PQresultStatus(kr) != PGRES_TUPLES_OK) {
+ mkfailure<bool>(string("Couldn't execute postgresql column select statement: ") + pgfailure(kr, conn));
+ return;
+ }
+ if (PQntuples(kr) != 2) {
+ PQclear(kr);
+ mkfailure<bool>(string("Couldn't find postgresql table key and value column names"));
+ return;
+ }
+ kname = PQgetvalue(kr, 0, 0);
+ vname = PQgetvalue(kr, 1, 0);
+ PQclear(kr);
}
PGSql(const PGSql& c) : owner(false), conn(c.conn), conninfo(c.conninfo), table(c.table) {
@@ -86,78 +104,29 @@ private:
bool owner;
PGconn *conn;
string conninfo;
- string table;
+ const string table;
+ string kname;
+ string vname;
friend const failable<bool> setup(const PGSql& pgsql);
friend const failable<bool> post(const value& key, const value& val, const PGSql& pgsql);
friend const failable<bool> put(const value& key, const value& val, const PGSql& pgsql);
friend const failable<value> get(const value& key, const PGSql& pgsql);
friend const failable<bool> del(const value& key, const PGSql& pgsql);
-
- /**
- * Setup the database connection.
- */
- const failable<bool> setup(const bool init) const {
-
- // Check the status of the connection and reconnect if necessary
- if (!init) {
- if (PQstatus(conn) == CONNECTION_OK)
- return true;
- debug("pgsql::setup::reset");
- PQreset(conn);
- if (PQstatus(conn) != CONNECTION_OK)
- return mkfailure<bool>(string("Couldn't reconnect to postgresql database: ") + PQerrorMessage(conn));
- }
- debug("pgsql::setup::init");
-
- // Find the name of the first column in the target table
- // Assume that's the key we need to use
- string ks = string("select a.attname from pg_attribute a, pg_class c where a.attrelid = c.relfilenode and c.relname = '") + table + string("' and a.attnum in (1, 2) order by a.attnum;");
- PGresult* kr = PQexec(conn, c_str(ks));
- if (PQresultStatus(kr) != PGRES_TUPLES_OK)
- return mkfailure<bool>(string("Couldn't execute postgresql column select statement: ") + pgfailure(kr, conn));
- if (PQntuples(kr) != 2) {
- PQclear(kr);
- return mkfailure<bool>(string("Couldn't find postgresql table key and value column names"));
- }
- const string kname = PQgetvalue(kr, 0, 0);
- const string vname = PQgetvalue(kr, 1, 0);
- PQclear(kr);
-
- // Prepare the post, put, get and delete statements
- {
- PGresult* r = PQprepare(conn, "post", c_str(string("insert into ") + table + string(" values($1, $2);")), 2, NULL);
- if (PQresultStatus(r) != PGRES_COMMAND_OK)
- return mkfailure<bool>(string("Couldn't prepare post postgresql SQL statement: ") + pgfailure(r, conn));
- PQclear(r);
- }
- {
- PGresult* r = PQprepare(conn, "put", c_str(string("update ") + table + string(" set ") + vname + string(" = $2 where ") + kname + string(" = $1;")), 2, NULL);
- if (PQresultStatus(r) != PGRES_COMMAND_OK)
- return mkfailure<bool>(string("Couldn't prepare put postgresql SQL statement: ") + pgfailure(r, conn));
- PQclear(r);
- }
- {
- PGresult* r = PQprepare(conn, "get", c_str(string("select * from ") + table + string(" where ") + kname + string(" = $1;")), 1, NULL);
- if (PQresultStatus(r) != PGRES_COMMAND_OK)
- return mkfailure<bool>(string("Couldn't prepare get postgresql SQL statement: ") + pgfailure(r, conn));
- PQclear(r);
- }
- {
- PGresult* r = PQprepare(conn, "delete", c_str(string("delete from ") + table + string(" where ") + kname + string(" = $1;")), 1, NULL);
- if (PQresultStatus(r) != PGRES_COMMAND_OK)
- return mkfailure<bool>(string("Couldn't prepare delete postgresql SQL statement: ") + pgfailure(r, conn));
- PQclear(r);
- }
- return true;
- }
};
/**
* Setup the database connection if necessary.
*/
const failable<bool> setup(const PGSql& pgsql) {
- return pgsql.setup(false);
+ debug("pgsql::setup");
+ if (PQstatus(pgsql.conn) == CONNECTION_OK)
+ return true;
+ debug("pgsql::setup::reset");
+ PQreset(pgsql.conn);
+ if (PQstatus(pgsql.conn) != CONNECTION_OK)
+ return mkfailure<bool>(string("Couldn't reconnect to postgresql database: ") + PQerrorMessage(pgsql.conn));
+ return true;
}
/**
@@ -173,7 +142,7 @@ const failable<bool> post(const value& key, const value& val, const PGSql& pgsql
const string ks(scheme::writeValue(key));
const string vs(scheme::writeValue(val));
const char* params[2] = { c_str(ks), c_str(vs) };
- PGresult* r = PQexecPrepared(pgsql.conn, "post", 2, params, NULL, NULL, 0);
+ PGresult* r = PQexecParams(pgsql.conn, c_str(string("insert into ") + pgsql.table + string(" values($1, $2);")), 2, NULL, params, NULL, NULL, 0);
if (PQresultStatus(r) != PGRES_COMMAND_OK)
return mkfailure<bool>(string("Couldn't execute insert postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
PQclear(r);
@@ -195,7 +164,7 @@ const failable<bool> put(const value& key, const value& val, const PGSql& pgsql)
const string ks(scheme::writeValue(key));
const string vs(scheme::writeValue(val));
const char* params[2] = { c_str(ks), c_str(vs) };
- PGresult* r = PQexecPrepared(pgsql.conn, "put", 2, params, NULL, NULL, 0);
+ PGresult* r = PQexecParams(pgsql.conn, c_str(string("update ") + pgsql.table + string(" set ") + pgsql.vname + string(" = $2 where ") + pgsql.kname + string(" = $1;")), 2, NULL, params, NULL, NULL, 0);
if (PQresultStatus(r) != PGRES_COMMAND_OK)
return mkfailure<bool>(string("Couldn't execute update postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
const string t = PQcmdTuples(r);
@@ -206,7 +175,7 @@ const failable<bool> put(const value& key, const value& val, const PGSql& pgsql)
}
PQclear(r);
- PGresult* pr = PQexecPrepared(pgsql.conn, "post", 2, params, NULL, NULL, 0);
+ PGresult* pr = PQexecParams(pgsql.conn, c_str(string("insert into ") + pgsql.table + string(" values($1, $2);")), 2, NULL, params, NULL, NULL, 0);
if (PQresultStatus(pr) != PGRES_COMMAND_OK)
return mkfailure<bool>(string("Couldn't execute insert postgresql SQL statement: ") + pgfailure(pr, pgsql.conn));
PQclear(pr);
@@ -226,14 +195,14 @@ const failable<value> get(const value& key, const PGSql& pgsql) {
const string ks(scheme::writeValue(key));
const char* params[1] = { c_str(ks) };
- PGresult* r = PQexecPrepared(pgsql.conn, "get", 1, params, NULL, NULL, 0);
+ PGresult* r = PQexecParams(pgsql.conn, c_str(string("select * from ") + pgsql.table + string(" where ") + pgsql.kname + string(" = $1;")), 1, NULL, params, NULL, NULL, 0);
if (PQresultStatus(r) != PGRES_TUPLES_OK)
return mkfailure<value>(string("Couldn't execute select postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
if (PQntuples(r) < 1) {
PQclear(r);
ostringstream os;
os << "Couldn't get postgresql entry: " << key;
- return mkfailure<value>(str(os));
+ return mkfailure<value>(str(os), 404, false);
}
const char* data = PQgetvalue(r, 0, 1);
const value val(scheme::readValue(string(data)));
@@ -254,7 +223,7 @@ const failable<bool> del(const value& key, const PGSql& pgsql) {
const string ks(scheme::writeValue(key));
const char* params[1] = { c_str(ks) };
- PGresult* r = PQexecPrepared(pgsql.conn, "delete", 1, params, NULL, NULL, 0);
+ PGresult* r = PQexecParams(pgsql.conn, c_str(string("delete from ") + pgsql.table + string(" where ") + pgsql.kname + string(" = $1;")), 1, NULL, params, NULL, NULL, 0);
if (PQresultStatus(r) != PGRES_COMMAND_OK)
return mkfailure<bool>(string("Couldn't execute delete postgresql SQL statement: ") + pgfailure(r, pgsql.conn));
PQclear(r);
diff --git a/sca-cpp/trunk/components/sqldb/sqldb.componentType b/sca-cpp/trunk/components/sqldb/sqldb.componentType
index 5aa6d8e30f..bd024213bd 100644
--- a/sca-cpp/trunk/components/sqldb/sqldb.componentType
+++ b/sca-cpp/trunk/components/sqldb/sqldb.componentType
@@ -23,7 +23,7 @@
targetNamespace="http://tuscany.apache.org/xmlns/sca/components">
<service name="sqldb"/>
- <property name="conninfo" type="xsd:string">host=localhost port=5432 dbname=db</property>
+ <property name="conninfo" type="xsd:string">host=localhost port=6432 dbname=db</property>
<property name="table" type=xsd:string"/>
</composite>
diff --git a/sca-cpp/trunk/components/sqldb/sqldb.composite b/sca-cpp/trunk/components/sqldb/sqldb.composite
index 19bafd8eca..9e102893b5 100644
--- a/sca-cpp/trunk/components/sqldb/sqldb.composite
+++ b/sca-cpp/trunk/components/sqldb/sqldb.composite
@@ -23,7 +23,7 @@
<component name="sqldb">
<implementation.cpp path="." library="libsqldb"/>
- <property name="conninfo">host=localhost port=5432 dbname=db</property>
+ <property name="conninfo">host=localhost port=6432 dbname=db</property>
<property name="table">test</property>
<service name="sqldb">
<binding.http uri="sqldb"/>
diff --git a/sca-cpp/trunk/configure.ac b/sca-cpp/trunk/configure.ac
index 2e7270e1d4..c40bd3bade 100644
--- a/sca-cpp/trunk/configure.ac
+++ b/sca-cpp/trunk/configure.ac
@@ -191,7 +191,7 @@ AC_ARG_ENABLE(malloc-mmap, [AS_HELP_STRING([--enable-malloc-mmap], [use mmap for
;;
esac ],
[ AC_MSG_RESULT(no)])
-if test "${want_efence}" = "true"; then
+if test "${want_malloc_mmap}" = "true"; then
AM_CONDITIONAL([WANT_MALLOC_MMAP], true)
AC_DEFINE([WANT_MALLOC_MMAP], 1, [use mmap for memory allocation])
else
@@ -264,6 +264,7 @@ AC_ARG_WITH([curl], [AC_HELP_STRING([--with-curl=PATH], [path to installed curl
AC_MSG_RESULT(/usr)
])
AC_SUBST(CURL_PREFIX)
+AC_DEFINE_UNQUOTED([CURL_PREFIX], "${CURL_PREFIX}", [path to installed curl])
AC_SUBST(LIBCURL_INCLUDE)
AC_SUBST(LIBCURL_LIB)
LIBS="-L${LIBCURL_LIB} ${defaultlibs}"
@@ -339,6 +340,7 @@ AC_ARG_WITH([httpd], [AC_HELP_STRING([--with-httpd=PATH], [path to installed Apa
AC_MSG_RESULT(/usr)
])
AC_SUBST(HTTPD_PREFIX)
+AC_DEFINE_UNQUOTED([HTTPD_PREFIX], "${HTTPD_PREFIX}", [path to installed Apache HTTPD])
AC_SUBST(HTTPD_APACHECTL_PREFIX)
AC_SUBST(HTTPD_MODULES_PREFIX)
AC_SUBST(HTTPD_INCLUDE)
@@ -365,6 +367,7 @@ AC_ARG_WITH([memcached], [AC_HELP_STRING([--with-memcached=PATH], [path to insta
AC_MSG_RESULT(/usr)
])
AC_SUBST(MEMCACHED_PREFIX)
+AC_DEFINE_UNQUOTED([MEMCACHED_PREFIX], "${MEMCACHED_PREFIX}", [path to installed memcached])
AC_MSG_CHECKING([for ${MEMCACHED_PREFIX}/bin/memcached])
if test -x "${MEMCACHED_PREFIX}/bin/memcached"; then
AC_MSG_RESULT(found)
@@ -386,6 +389,7 @@ AC_ARG_WITH([tinycdb], [AC_HELP_STRING([--with-tinycdb=PATH], [path to installed
AC_MSG_RESULT(/usr)
])
AC_SUBST(TINYCDB_PREFIX)
+AC_DEFINE_UNQUOTED([TINYCDB_PREFIX], "${TINYCDB_PREFIX}", [path to installed tinycdb])
AC_SUBST(TINYCDB_INCLUDE)
AC_SUBST(TINYCDB_LIB)
LIBS="-L${TINYCDB_LIB} ${defaultlibs}"
@@ -428,6 +432,7 @@ if test "${want_python}" = "true"; then
AC_MSG_RESULT(/usr)
])
AC_SUBST(PYTHON_PREFIX)
+ AC_DEFINE_UNQUOTED([PYTHON_PREFIX], "${PYTHON_PREFIX}", [path to installed Python])
AC_SUBST(PYTHON_INCLUDE)
AC_SUBST(PYTHON_LIB)
LIBS="-L${PYTHON_LIB} ${defaultlibs}"
@@ -480,6 +485,7 @@ if test "${want_pagespeed}" = "true"; then
fi
AM_CONDITIONAL([WANT_PAGESPEED], true)
AC_DEFINE([WANT_PAGESPEED], 1, [run Page Speed optimizations])
+ AC_DEFINE_UNQUOTED([PAGESPEED_PREFIX], "${PAGESPEED_PREFIX}", [path to installed Page Speed])
else
AM_CONDITIONAL([WANT_PAGESPEED], false)
fi
@@ -559,6 +565,7 @@ if test "${want_java}" = "true"; then
AC_MSG_RESULT(/usr/lib/jvm/default-java)
])
AC_SUBST(JAVA_PREFIX)
+ AC_DEFINE_UNQUOTED([JAVA_PREFIX], "${JAVA_PREFIX}", [path to installed Java])
AC_SUBST(JAVA_INCLUDE)
AC_SUBST(JAVAC)
AC_SUBST(JAR)
@@ -655,6 +662,7 @@ if test "${want_openid}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(MODAUTHOPENID_PREFIX)
+ AC_DEFINE_UNQUOTED([MODAUTHOPENID_PREFIX], "${MODAUTHOPENID_PREFIX}", [path to installed mod-auth-openid])
AM_CONDITIONAL([WANT_OPENID], true)
AC_DEFINE([WANT_OPENID], 1, [enable OpenID support])
@@ -726,6 +734,7 @@ if test "${want_modsecurity}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(MODSECURITY_PREFIX)
+ AC_DEFINE_UNQUOTED([MODSECURITY_PREFIX], "${MODSECURITY_PREFIX}", [path to installed mod-security])
AM_CONDITIONAL([WANT_MODSECURITY], true)
AC_DEFINE([WANT_MODSECURITY], 1, [enable mod-security support])
@@ -827,6 +836,7 @@ if test "${want_webservice}" = "true"; then
AC_MSG_RESULT(/usr/local/axis2c)
])
AC_SUBST(AXIS2C_PREFIX)
+ AC_DEFINE_UNQUOTED([AXIS2C_PREFIX], "${AXIS2C_PREFIX}", [path to installed Axis2C])
AC_SUBST(AXIS2C_INCLUDE)
AC_SUBST(AXIS2C_LIB)
LIBS="-L${AXIS2C_LIB} ${defaultlibs}"
@@ -868,9 +878,22 @@ if test "${want_sqldb}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(PGSQL_PREFIX)
+ AC_DEFINE_UNQUOTED([PGSQL_PREFIX], "${PGSQL_PREFIX}", [path to installed PostgreSQL])
AC_SUBST(PGSQL_INCLUDE)
AC_SUBST(PGSQL_LIB)
+ # Configure path to PgBouncer.
+ AC_MSG_CHECKING([for pgbouncer])
+ AC_ARG_WITH([pgbouncer], [AC_HELP_STRING([--with-pgbouncer=PATH], [path to installed PgBouncer [default=/usr/local]])], [
+ PGBOUNCER_PREFIX="${withval}"
+ AC_MSG_RESULT("${withval}")
+ ], [
+ PGBOUNCER_PREFIX="/usr/local"
+ AC_MSG_RESULT(/usr/local)
+ ])
+ AC_SUBST(PGBOUNCER_PREFIX)
+ AC_DEFINE_UNQUOTED([PGBOUNCER_PREFIX], "${PGBOUNCER_PREFIX}", [path to installed PgBouncer])
+
AM_CONDITIONAL([WANT_SQLDB], true)
AC_DEFINE([WANT_SQLDB], 1, [enable SQL Database component])
else
@@ -906,6 +929,7 @@ if test "${want_queue}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(QPIDC_PREFIX)
+ AC_DEFINE_UNQUOTED([QPIDC_PREFIX], "${QPIDC_PREFIX}", [path to installed Qpid/C++])
AC_SUBST(QPIDC_INCLUDE)
AC_SUBST(QPIDC_LIB)
@@ -1015,6 +1039,7 @@ if test "${want_log}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(THRIFT_PREFIX)
+ AC_DEFINE_UNQUOTED([THRIFT_PREFIX], "${THRIFT_PREFIX}", [path to installed Apache Thrift])
AC_SUBST(THRIFT_INCLUDE)
AC_SUBST(THRIFT_LIB)
AC_SUBST(FB303_PREFIX)
@@ -1035,6 +1060,7 @@ if test "${want_log}" = "true"; then
AC_MSG_RESULT(/usr/local)
])
AC_SUBST(SCRIBE_PREFIX)
+ AC_DEFINE_UNQUOTED([SCRIBE_PREFIX], "${SCRIBE_PREFIX}", [path to installed Facebook Scribe])
AC_SUBST(SCRIBE_INCLUDE)
AC_SUBST(SCRIBE_LIB)
diff --git a/sca-cpp/trunk/macos/macos-install b/sca-cpp/trunk/macos/macos-install
index 9a92901029..e8332edfd2 100755
--- a/sca-cpp/trunk/macos/macos-install
+++ b/sca-cpp/trunk/macos/macos-install
@@ -276,7 +276,7 @@ if [ "$?" != "0" ]; then
fi
cd $build
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
curl -OL http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz
tar xzf postgresql-9.1.2.tar.gz
cd postgresql-9.1.2
@@ -287,6 +287,17 @@ if [ "$?" != "0" ]; then
exit $?
fi
cd $build
+curl -OL http://pgfoundry.org/frs/download.php/3197/pgbouncer-1.5.tar.gz
+tar xzf pgbouncer-1.5.tar.gz
+cd pgbouncer-1.5
+./configure --prefix=$build/pgbouncer-1.5-bin --with-libevent=$build/libevent-2.0.13-stable-bin
+make
+cp install-sh doc
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
# Build Apache Libcloud
curl -OL http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
@@ -310,7 +321,7 @@ cd $build
git clone git://git.apache.org/tuscany-sca-cpp.git
cd tuscany-sca-cpp
./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
make
make install
if [ "$?" != "0" ]; then
@@ -319,8 +330,8 @@ fi
cd $build
# Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
# Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin pgbouncer-1.5-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
diff --git a/sca-cpp/trunk/samples/store-cluster/shared/shared.composite b/sca-cpp/trunk/samples/store-cluster/shared/shared.composite
index 9ac6388d58..d11d31b9ea 100644
--- a/sca-cpp/trunk/samples/store-cluster/shared/shared.composite
+++ b/sca-cpp/trunk/samples/store-cluster/shared/shared.composite
@@ -44,7 +44,7 @@
<component name="Masterdb">
<implementation.cpp path="../../../components/sqldb" library="libsqldb"/>
- <property name="conninfo">host=localhost port=5432 dbname=db</property>
+ <property name="conninfo">host=localhost port=6432 dbname=db</property>
<property name="table">store</property>
<service name="Masterdb">
<binding.atom uri="masterdb"/>
@@ -53,7 +53,7 @@
<component name="Standbydb">
<implementation.cpp path="../../../components/sqldb" library="libsqldb"/>
- <property name="conninfo">host=localhost port=5433 dbname=db</property>
+ <property name="conninfo">host=localhost port=6433 dbname=db</property>
<property name="table">store</property>
<service name="Standbydb">
<binding.atom uri="standbydb"/>
diff --git a/sca-cpp/trunk/samples/store-sql/store.composite b/sca-cpp/trunk/samples/store-sql/store.composite
index 34337a637a..bb6898140f 100644
--- a/sca-cpp/trunk/samples/store-sql/store.composite
+++ b/sca-cpp/trunk/samples/store-sql/store.composite
@@ -79,7 +79,7 @@
<component name="Sqldb">
<implementation.cpp path="../../components/sqldb" library="libsqldb"/>
- <property name="conninfo">host=localhost port=5432 dbname=db</property>
+ <property name="conninfo">host=localhost port=6432 dbname=db</property>
<property name="table">store</property>
<service name="Sqldb">
<binding.atom uri="sqldb"/>
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-backup b/sca-cpp/trunk/ubuntu/ubuntu-backup
index 53b15a7772..62e0bc5415 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-backup
+++ b/sca-cpp/trunk/ubuntu/ubuntu-backup
@@ -23,8 +23,8 @@
set -x
# Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
# Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-backup-all b/sca-cpp/trunk/ubuntu/ubuntu-backup-all
index 66d8da7d4b..609a570bed 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-backup-all
+++ b/sca-cpp/trunk/ubuntu/ubuntu-backup-all
@@ -23,8 +23,8 @@
set -x
# Create src archive
-tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
# Create bin archive
-tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install b/sca-cpp/trunk/ubuntu/ubuntu-install
index ce634a1e21..71fd6d7d0f 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-install
+++ b/sca-cpp/trunk/ubuntu/ubuntu-install
@@ -249,7 +249,7 @@ if [ "$?" != "0" ]; then
fi
cd $build
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
sudo apt-get -y install libreadline-dev
if [ "$?" != "0" ]; then
exit $?
@@ -264,9 +264,20 @@ if [ "$?" != "0" ]; then
exit $?
fi
cd $build
+curl -OL http://pgfoundry.org/frs/download.php/3197/pgbouncer-1.5.tar.gz
+tar xzf pgbouncer-1.5.tar.gz
+cd pgbouncer-1.5
+./configure --prefix=$build/pgbouncer-1.5-bin
+make
+cp install-sh doc
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
# Build Apache Thrift
-sudo apt-get -y install bison flex python-dev libboost-dev libboost-filesystem-dev
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
if [ "$?" != "0" ]; then
exit $?
fi
@@ -274,7 +285,7 @@ curl -OL http://archive.apache.org/dist/incubator/thrift/0.2.0-incubating/thrift
tar xzf thrift-0.2.0-incubating.tar.gz
cd thrift-0.2.0
./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin PY_PREFIX=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
make
make install
if [ "$?" != "0" ]; then
@@ -345,7 +356,7 @@ cd $build
git clone git://git.apache.org/tuscany-sca-cpp.git
cd tuscany-sca-cpp
./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
make
make install
if [ "$?" != "0" ]; then
@@ -354,8 +365,8 @@ fi
cd $build
# Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
# Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install-all b/sca-cpp/trunk/ubuntu/ubuntu-install-all
index 63500e953b..a3acbd3c6b 100755
--- a/sca-cpp/trunk/ubuntu/ubuntu-install-all
+++ b/sca-cpp/trunk/ubuntu/ubuntu-install-all
@@ -303,7 +303,7 @@ if [ "$?" != "0" ]; then
fi
cd $build
-# Build PostgreSQL
+# Build PostgreSQL and PgBouncer
sudo apt-get -y install libreadline-dev
if [ "$?" != "0" ]; then
exit $?
@@ -318,9 +318,20 @@ if [ "$?" != "0" ]; then
exit $?
fi
cd $build
+curl -OL http://pgfoundry.org/frs/download.php/3197/pgbouncer-1.5.tar.gz
+tar xzf pgbouncer-1.5.tar.gz
+cd pgbouncer-1.5
+./configure --prefix=$build/pgbouncer-1.5-bin
+make
+cp install-sh doc
+make install
+if [ "$?" != "0" ]; then
+ exit $?
+fi
+cd $build
# Build Apache Thrift
-sudo apt-get -y install bison flex python-dev libboost-dev libboost-filesystem-dev
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
if [ "$?" != "0" ]; then
exit $?
fi
@@ -328,7 +339,7 @@ curl -OL http://archive.apache.org/dist/incubator/thrift/0.2.0-incubating/thrift
tar xzf thrift-0.2.0-incubating.tar.gz
cd thrift-0.2.0
./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin PY_PREFIX=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
make
make install
if [ "$?" != "0" ]; then
@@ -399,7 +410,7 @@ cd $build
git clone git://git.apache.org/tuscany-sca-cpp.git
cd tuscany-sca-cpp
./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-gae --with-gae=$build/google_appengine --enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-gae --with-gae=$build/google_appengine --enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin
make
make install
if [ "$?" != "0" ]; then
@@ -408,7 +419,7 @@ fi
cd $build
# Create src archive
-tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
# Create bin archive
tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6