[Pgpool-general] pgpool with enterprisedb + slony-I

gurkan at resolution.com gurkan at resolution.com
Wed Mar 29 18:14:34 GMT 2006


Hi all,
I have installed and running enterprisedb_8.1.3.12 with slony-I replication.
I am testing/trying to run pgpool as load balancer.
I have installed pgpool and followed the Documentation to configure pgpool.conf.
I run the pgpool and when I run my test java class to do some insertion through
pgpool I get the error below:

pgpool is running on machine *.*.*.205:9999
master DB is running on *.*.*.203:5444
slave DB is running on *.*.*.204:5444

pgpool logfile output:
***********************************
[gurkan at primary ~]$ tail -f /tmp/pgpool.log
2006-03-30 01:54:31 LOG:   pid 3569: pgpool successfully started
2006-03-30 01:54:31 LOG:   pid 3569: starting health checking
2006-03-30 01:54:51 LOG:   pid 3569: starting health checking
2006-03-30 01:55:04 ERROR: pid 3600: read_kind: kind does not match between
backends master(83) secondary(69)
2006-03-30 01:55:04 ERROR: pid 3600: pool_do_auth: failed to read kind before
backendkeydata
2006-03-30 01:55:11 LOG:   pid 3569: starting health checking
2006-03-30 01:55:32 LOG:   pid 3569: starting health checking
***********************************

java class exception error output:
***********************************
[gurkan at primary edb]$ java TestPgpool
SQL Exception: The connection attempt failed.
SQL State: 08001
Vendor Error: 0
***********************************


pgpool.conf file:
***********************************
listen_addresses = '192.168.5.205'

# port number for pgpool
port = 9999

# Unix domain socket path. Debian package default to /var/run/postgresql!
socket_dir = '/tmp'

# host name where PostgreSQL server is running on. '' means localhost using UNIX
# domain socket
backend_host_name = '192.168.5.203'

# port number PostgreSQL server is running on.
backend_port = 5444

# Unix domain socket path for the backend. Debian package default 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 = '192.168.5.204'

# port number secondary PostgreSQL server is running on.
# 0 means no secondrary PostgreSQL
secondary_backend_port = 5444

# number of pre-forked child process
num_init_children = 32

# numer of connection pool allowed for a child process.
max_pool = 4

# if idle for this seconds, child exits. 0 means no timeout.
child_life_time = 300

# if idle for this seconds, connection to PostgreSQL closes. 0 means
# no timeout
connection_life_time = 0

# if child_max_connections connections were received, child exits. 0 means no exit.
child_max_connections = 0

# logging directory
logdir = '/tmp'

# replication mode
replication_mode = false

# set this to true if you want to avoid deadlock situation when
# replication enabled.
# there will be noticable performance degration, however.
# a work around is set this to false and insert /*STRICT*/ comment
# at the beginning of the SQL command.
replication_strict = true

# when replication_strict is set to false, there will be a chance for
# deadlocks. set this to non 0 (in milli seconds) to detect this
# situation and resolve the deadlock by aborting current session.
replication_timeout = 5000

# load balancing mode. i.e. all SELECT except in a transaction block
# are load balanced. This is ignored if replication_mode is false.
load_balance_mode = true

# load balance weight for master and secondary. actual weight is
# calculated by weight_master:weight_secondary. For example both
#
# weight_master = 10 and weight_secondary = 5
# weight_master = 4 and weight_secondary = 2
#
# are regarded as master has double the weight comparing with secondary.
# master and secondary have same weight in the default.
weight_master = 0.5
weight_secondary = 0.5

# if there's a data mismatch between master and secondary
# start degenration to stop replication mode
replication_stop_on_mismatch = false

# semicolon separated list of quries to be issued at the end of session
reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'

# if true print time stamp to each log line
print_timestamp = true

# if true, operate in master/slave mode
master_slave_mode = true

# if true, cache connection pool
connection_cache = true

# health check timeout. 0 means no timeout;
health_check_timeout = 20

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

# health check user
health_check_user = 'enterprisedb'

# if true, automatically lock table with INSERT statement to keep SERIAL
# data consistency. /*INSERT LOCK*/ comment has the same effect.
# /NO INSERT LOCK*/ comment disables the effect.
insert_lock = false

# if true, ignore leading white spaces of each query while pgpool
# judges if the query is a SELECT so that it can be load balnced. This
# is usefull for certain APIs such as DBI/DBD which is know as adding
# an extra leading white space.
ignore_leading_white_space = true

***********************************

connection string that I am using:
IP 205 is where the pgpool is running and master DB is on 203:5444 and slave DB
is on 204:5444
***********************************
Connection con =
DriverManager.getConnection("jdbc:edb://192.168.5.205:9999/edb_master",
"enterprisedb","enterprisedb");
***********************************

Thanks for help.

-------------------------------------------------
This mail sent through IMP: www.resolution.com


More information about the Pgpool-general mailing list