Technology Errors

createdb: database creation failed: ERROR: source database “template1” is being accessed by other users

When attempting to create a new database on a PostgreSQL server running walmgr, which is part of SkyTools by Skype Developers, for real time failover I received an error. Initially I was a bit baffled by the error however I remembered after racking my brain for a little bit that you must stop walmgr’s syncdaemon when adding a new database. Below are more details about the error as well as how to stop walmgr’s syncdaemon and then create the new database.

Technology Errors

PostgreSQL SkyTools walmgr: CDTWARNING: archive_mode enabled, yet archive_command is not set

If you are running walmgr for log shipping with PostgreSQL and you see the below error in your postgresql.log file it is because you are missing the recovery.conf file. The recovery.conf file should be located in your data directory on the slave server which typically is /var/lib/pgsql/data.

CDTWARNING: archive_mode enabled, yet archive_command is not set

This means you probably have not run the below command as the postgres user on the slave server which is the command that actually generates the recovery.conf file.

Technology Insights

How to Upgrade PostgreSQL SkyTools walmgr from 2.1.x to 2.1.9

Upgrading is easy since really this is just a python script. The most complicated part of the upgrade process will be keeping your database cluster up. Follow the below steps and you should avoid any downtime.

  1. Download Latest SkyTools: Visit PgFoundry to download the latest SkyTools. Issue the below command from /usr/local/src on each server.

    1. wget

Technology Errors

PostgreSQL SkyTools walmgr: Can’t boot Slave: DEBUG Only single loop requested, exiting

I ran into a silly error tonight during some configuration changes for PostgreSQL that took me awhile to figure out so I wanted to share so it might save others some time in the future. In an attempt to boot the slave server in a PostgreSQL SkyTools walmgr configuration I was unable to get it operational. The server would seem like it was stopping recovery mode however I was unable to login and the recovery process was still showing. Eventually I used the verbose switch to see if I could gain more information about why it was not booting up and the output is below.

Command: conf/wal-slave.ini boot -v

2009-04-22 01:24:22,949 3899 INFO Stopping recovery mode
2009-04-22 01:24:22,949 3899 DEBUG Using pg_auth file from master.
2009-04-22 01:24:22,950 3899 DEBUG Execute cmd: ‘cp’ ‘/var/lib/pgsql/walshipping/logs.complete/pg_auth’ ‘/var/lib/pgsql/data/global/pg_auth’
2009-04-22 01:24:22,955 3899 DEBUG Only single loop requested, exiting