#!/bin/zsh # # I'm not using this script anymore, but I used it to setup the database # initially. It may make assumptions about everything running on one machine, # as was the case at the time. PGBASE=/u/drkp/build/postgresql-8.2.11/obj PGBIN=$PGBASE/bin PGDATA=$PGBASE/data WEBHOST=farm13 export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.10 # make-properties needs this to be set; initDB doesn't actually care # about the value. export NUM_CLIENTS=2000 eval `ssh-agent` ssh-add echo "Starting postgres" ssh $WEBHOST sudo /etc/init.d/apache2 restart sudo -u postgres $PGBIN/pg_ctl -D $PGDATA stop sudo -u postgres $PGBIN/pg_ctl -D $PGDATA start sleep 5 sudo ln -s /tmp/.s.PGSQL.* /var/run/postgresql echo "Setting up the database" ./make-properties mediumsize medium $PGBIN/createuser -SdR cecchet $PGBIN/dropdb -U cecchet rubis cat database/rubis.postgres.sql | $PGBIN/psql -U cecchet postgres cat database/{categories.sql,regions.sql} | sed 's/#.*//;s/(NULL/(DEFAULT/' | $PGBIN/psql -U cecchet rubis echo "Running initDB" make initDB PARAM=all cat database/update_old_items.sql | $PGBIN/psql -U cecchet rubis #echo "Running benchmark" #make emulator #echo "Stopping postgres" #sudo -u postgres $PGBIN/pg_ctl -D $PGDATA stop kill $SSH_AGENT_PID