[Pgpool-general] pgpool problem when working in loadbalancing mode]

dan bordeanu dan at sci-office.com
Tue Nov 6 16:32:40 UTC 2007


hello

i have a small problem with pgpool when it's set to work in loadbalancing
mode.

this is my setup.

two pgsql serveres, one is master, second is slave.
pgpool is conneting to master slave and all the sql data are  replicated
in slave mode.
in my pgpool config file i have:


backend_host_name = 'master_sql_server'

# port number PostgreSQL server is running on
backend_port = 5432

# Unix domain socket path for the backend.  (The Debian package defaults #
to /var/run/postgresql.)
backend_socket_dir = '/tmp'

# Host name where secondary PostgreSQL server is running on.  '' means #
localhost using Unix domain socket.
secondary_backend_host_name = 'slave_sql_server'

# Port number secondary PostgreSQL server is running on.  0 means no #
secondary PostgreSQL.
secondary_backend_port = 5432

# Replication mode
replication_mode = true
[..]
load_balance_mode = true
[..]
# Health check timeout.  0 means no timeout.
health_check_timeout = 20

# Health check period.  0 means no health check.
health_check_period = 20

from pgpool logs i have:
2007-11-06 18:04:20 LOG:   pid 13228: starting health checking

so, everything is ok, the master sql receive connection from pgpool, the
data is replicated, all is good until , the master sql server is
stopped/going down
At this momonet, pgpool is entering in degeneration mode.

2007-11-06 18:10:57 LOG:   pid 13228: starting degeneration. shutdown
master host maser_sql_server(5432)
2007-11-06 18:10:57 LOG:   pid 13228: degeneration done. shutdown master
host naster_sql_server(5432)

my sql applications  are still running because the sql data is also on the
slave sql server.

After a while the master_sql server is restarted/back on line , and here
is my problem.
Why the healt checking is not notified about the restart of the
master_server?
Offcourse, because of that, pgpool is using the slave_sql_server, and all
my application the same(from pgsql slave logs i sure that pgpool is
connectig to the slave, not to master, and the sql data is inserted only
in the slave server)

pgpool status looks like this
 server_status                | master(master_sql_server on 5432) down
secondary(slave_sql_server on 5432) up | server status

never the less, master_sql is up&running, so , why the pgpool is not
reporting that and redirect all the sql query on the master_sql_server

The solution is to restart the pgpool, but is not ok to do that.After the
restat, pgpool connects to master_sql server.

what i am doing wrong?

thx







More information about the Pgpool-general mailing list