Hi everyone! I have set up a cluster with two nodes of PostgreSQL 8.3 and pgpool-II 2.1, with replication, connection pooling and load balance. It is working fine and I can do online recovery with no problem.
I was using failover_command and failback_command in the form of "echo something" and then I decided to call an external script as I wanted to, first, log to the syslog, and second, be able to do something else, like send an email or similar. Here you are the parameters: failover_command = '/var/lib/postgresql/8.3/main/pgpool-failover %d %h %p %D %m %M' failback_command = '/var/lib/postgresql/8.3/main/pgpool-failback %d %h %p %D %m %M' And this is the /var/lib/postgresql/8.3/main/pgpool-failover script (the pgpool-failback command is identical but it echoes failback instead of failover to the syslog): #! /bin/sh LOGGER="/usr/bin/logger -i -p local0.info -t pgpool" BASENAME=`/usr/bin/basename $0` ID=`/usr/bin/id -un` $LOGGER "Executing $BASENAME as user $ID" $LOOGER "Failover of node $1 at hostname $2. New master node is $5. Old master node was $6." exit 0 This is the relevant part of the syslog when shutting down the PostgreSQL in the second node and doing an online recovery: Nov 4 15:45:15 xen01 pgpool: 2008-11-04 15:45:15 LOG: pid 29203: execute command: /var/lib/postgresql/8.3/main/pgpool-failover 1 10.0.33.253 5432 /var/lib/postgresql/8.3/main 0 0 Nov 4 15:45:15 xen01 pgpool[29245]: Executing pgpool-failover as user postgres Nov 4 15:45:15 xen01 pgpool: /var/lib/postgresql/8.3/main/pgpool-failover: 15: Failover of node 1 at hostname 10.0.33.253. New master node is 0. Old master node was 0.: not found [..] Nov 4 15:47:13 xen01 pgpool: 2008-11-04 15:47:13 LOG: pid 29203: execute command: /var/lib/postgresql/8.3/main/pgpool-failback 1 10.0.33.253 5432 /var/lib/postgresql/8.3/main 0 0 Nov 4 15:47:13 xen01 pgpool: 2008-11-04 15:47:13 LOG: pid 29239: recovery done Nov 4 15:47:13 xen01 pgpool[29366]: Executing pgpool-failback as user postgres Nov 4 15:47:13 xen01 pgpool: /var/lib/postgresql/8.3/main/pgpool-failback: 15: Failback of node 1 at hostname 10.0.33.253. New master node is 0. Old master node was 0.: not found Now my question is: what is that ": not found" at the end of the script execution doing there? I've been trying to figure it out but no luck. It did not happen when the failover_command and failback_command looked like "echo something > file.log". Any hints? Thanks in advance. -- Jaume Sabater http://linuxsilo.net/ "Ubi sapientas ibi libertas" _______________________________________________ Pgpool-general mailing list [email protected] http://pgfoundry.org/mailman/listinfo/pgpool-general
