Skip to content

4. Bare mental Deployment

Gang Liao edited this page Mar 10, 2021 · 5 revisions

BullFrog

We provide Docker images is to help users to deploy BullFrog. However, in order to achieve maximum performance, please follow this post to set up BullFrog on physical machines.

1. Build BullFrog

git clone https://github.com/DSLAM-UMD/BullFrog

cd BullFrog

# set environment variables for bullfrog installation
# you can set these variables in `~/.bashrc`, and then `source ~/.bashrc`
# warn: Please pay attention to the settings of `POSTGRES_INSTALLDIR`.
export POSTGRES_INSTALLDIR=$PWD/dev
export LD_LIBRARY_PATH=$POSTGRES_INSTALLDIR/lib:$LD_LIBRARY_PATH
export PATH=$POSTGRES_INSTALLDIR/bin:$PATH
export PGDATA=$POSTGRES_INSTALLDIR/data

# create installation dir
mkdir -p $POSTGRES_INSTALLDIR
cd postgresql-11.0/
./configure --prefix=$POSTGRES_INSTALLDIR --enable-cassert --enable-debug CFLAGS="-ggdb -Og -g3 -fno-omit-frame-pointer"

# compile bullfrog
make -j8
# install bullfrog
make install

2. Deploy BullFrog

# create a new BullFrog database
rm -rf $PGDATA
initdb -D $PGDATA

# set postgresql configuration file
cp postgresql.conf $PGDATA/

# you can now start the database server
pg_ctl -D $PGDATA -o "-F -p 5433" start
pg_ctl -D $PGDATA status

createdb -h localhost -p 5433 tpcc
psql -h localhost -p 5433 tpcc -c "CREATE USER postgres WITH SUPERUSER PASSWORD 'postgres';"
# "ERROR:  role "postgres" already exists" This error is fine. 

BullFrog OLTP-Benchmark

1. Build BullFrog OLTP-Benchmark

git clone https://github.com/DSLAM-UMD/BullFrog-Oltpbench

cd BullFrog-Oltpbench

ant bootstrap
ant resolve
ant build

2. Load TPC-C Dataset

./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_proj.xml --create=true --load=true --port=5433

3. Run TPC-C Benchmark with Online Schema Migration

Please re-execute all commands in this step if the benchmark fails to run.

# Clean tuples in new tables with new schemas
# `clean_new_tables.sql` is located in the folder `BullFrog-Oltpbench`.
$ psql -h localhost -p 5433 tpcc -f clean_new_tables.sql

# Clean shared memory via restarting database
$ pg_ctl -D $PGDATA restart 

# run benchmark
$ ./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_proj.xml  --execute=true -s 1 -o lazy_proj --port=5433 --bgthread=proj

Stop BullFrog

pg_ctl -D $PGDATA stop
pg_ctl -D $PGDATA status

Different Schema Migrations

Table Split Migration

# git branch https://github.com/DSLAM-UMD/BullFrog/tree/migrate-projection-on-bitmap
psql -h localhost -p 5433 tpcc -f clean_new_tables.sql
pg_ctl -D $PGDATA restart
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_proj.xml --create=true --load=true --port=5433
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_proj.xml  --execute=true -s 1 -o lazy_proj --port=5433 --bgthread=proj

Aggregate Migration

# git branch https://github.com/DSLAM-UMD/BullFrog/tree/migrate-aggregation-on-hashtable
psql -h localhost -p 5433 tpcc -f clean_new_tables.sql
pg_ctl -D $PGDATA restart
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_agg.xml --create=true --load=true --port=5433
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_agg.xml  --execute=true -s 1 -o lazy_agg --port=5433 --bgthread=agg

Join Migration

# git branch https://github.com/DSLAM-UMD/BullFrog/tree/migrate-join-on-hashtable
psql -h localhost -p 5433 tpcc -f clean_new_tables.sql
pg_ctl -D $PGDATA restart
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_join.xml --create=true --load=true --port=5433
./oltpbenchmark -b tpcc -c config/pgtpcc_lazy_join.xml  --execute=true -s 1 -o lazy_join --port=5433 --bgthread=join

Clone this wiki locally