PGObject-Util-Replication-Standby

 view release on metacpan or  search on metacpan

t/helpers/travis-setup.sh  view on Meta::CPAN

sudo sh -c "cat t/helpers/config/main.conf >> /etc/postgresql/$PGVERSION/main2/postgresql.conf"
sudo pg_ctlcluster $PGVERSION main2 start
sudo -u postgres createuser -s -p 5433 travis &>/dev/null

# create replica
sudo service postgresql stop
sudo pg_createcluster -u travis $PGVERSION replica # PORT 5434
sudo sh -c "cat t/helpers/config/main.conf >> /etc/postgresql/$PGVERSION/replica/postgresql.conf"
sudo rm -rf ~postgres/$PGVERSION/replica 
sudo cp -r ~postgres/$PGVERSION/main2 ~postgres/$PGVERSION/replica 
sudo chown -R travis ~postgres/$PGVERSION/replica
sudo cp t/helpers/config/recovery.conf ~postgres/$PGVERSION/replica
sudo sh -c "cat t/helpers/config/replica.conf >> /etc/postgresql/$PGVERSION/replica/postgresql.conf"
sudo sh -c "echo 'local replication	travis	trust' >> /etc/postgresql/$PGVERSION/main2/pg_hba.conf"
sudo service postgresql start $PGVERSION

#diagnostics and more
echo 'sleeping for 3 sec'
sudo pg_lsclusters;
sleep 3
sudo ls /var/log/postgresql/



( run in 0.832 second using v1.01-cache-2.11-cpan-5511b514fd6 )