ТОВАРИЩИ ХЕЛППП!!
Есть 2 postgres и pgpool, результаты работы смотрю по логам .
если один postgresql просто стопнуть, то pgpool достаточно быстро это замечает
# Health check timeout. 0 means no timeout.
health_check_timeout = 10
# Health check period. 0 means no health check.
health_check_period = 2
если положить машину на которой стоит postgresql то pgpool замечает, что вторая субд лежит только мин, через 3
в доке pgpool ничего не нашла, эксперементы тоже пока не дают положительный результат.
Pgpool коннекты реализованы с использованием сокетов , вот кручу sysctl свойства, но результата пока тоже нет ( тема в unix RH4Up4)
PGPOOL.CONFIG
# If child_max_connections connections were received, child exits.\n# 0 means no exit.\nchild_max_connections = 0 \n\n# If client_idle_limit is n (n > 0 ), the client is forced to be\n# disconnected whenever after n seconds idle (even inside an explicit\n# transactions!)\n# 0 means no disconnect.\nclient_idle_limit = 300 \n\n# Maximum time in seconds to complete client authentication.\n# 0 means no timeout.\nauthentication_timeout = 20 \n\n# Logging directory\nlogdir = \'/tmp\'\n\n# Replication mode\nreplication_mode = true\n\n# Load balancing mode, i.e., all SELECTs are load balanced.\n# This is ignored if replication_mode is false.\nload_balance_mode = false\n\n# if there s a data mismatch between master and secondary\n# start degeneration to stop replication mode\nreplication_stop_on_mismatch = false\n\n# If true, replicate SELECT statement when load balancing is disabled.\n# If false, it is only sent to the master node.\n#\n# pgpool-II configuration file sample\n# $Header: /cvsroot/pgpool/pgpool-II/pgpool.conf.sample,v 1 . 21 2008 / 03 / 18 08 : 39 : 02 y-asaba Exp $\n\n# Host name or IP address to listen on: \'*\' for all, \'\' for no TCP/IP\n# connections\nlisten_addresses = \'*\'\n\n# Port number for pgpool\nport = 9999 \n\n# Port number for pgpool communication manager\npcp_port = 9898 \n\n# Unix domain socket path. (The Debian package defaults to\n# /var/run/postgresql.)\nsocket_dir = \'/tmp\'\n\n# Unix domain socket path for pgpool communication manager.\n# (Debian package defaults to /var/run/postgresql)\npcp_socket_dir = \'/tmp\'\n\n# Unix domain socket path for the backend. Debian package defaults to /var/run/postgresql!\nbackend_socket_dir = \'/tmp\'\n\n# pgpool communication manager timeout. 0 means no timeout, but strongly not recommended!\npcp_timeout = 10 \n\n# number of pre-forked child process\nnum_init_children = 32 \n\n# Number of connection pools allowed for a child process\nmax_pool = 100 \n\n# If idle for this many seconds, child exits. 0 means no timeout.\nchild_life_time = 300 \n\n# If idle for this many seconds, connection to PostgreSQL closes.\n# 0 means no timeout.\nconnection_life_time = 300 \n\n# If child_max_connections connections were received, child exits.\n# 0 means no exit.\nchild_max_connections = 0 \n\n# If client_idle_limit is n (n > 0 ), the client is forced to be\n# disconnected whenever after n seconds idle (even inside an explicit\n# transactions!)\n# 0 means no disconnect.\nclient_idle_limit = 300 \n\n# Maximum time in seconds to complete client authentication.\n# 0 means no timeout.\nauthentication_timeout = 20 \n\n# Logging directory\nlogdir = \'/tmp\'\n\n# Replication mode\nreplication_mode = true\n\n# Load balancing mode, i.e., all SELECTs are load balanced.\n# This is ignored if replication_mode is false.\nload_balance_mode = false\n\n# if there\'s \'a data mismatch between master and secondary\n# start degeneration to stop replication mode\nreplication_stop_on_mismatch = false\n\n# If true, replicate SELECT statement when load balancing is disabled.\n# If false, it is only sent to the master node.\nreplicate_select = false\n\n# Semicolon separated list of queries to be issued at the end of a session\nreset_query_list = \'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT\'\n\n# If true print timestamp on each log line.\nprint_timestamp = true\n\n# If true, operate in master/slave mode.\nmaster_slave_mode = false\n\n# If true, cache connection pool.\nconnection_cache = true\n\n# Health check timeout. 0 means no timeout.\nhealth_check_timeout = 10 \n\n# Health check period. 0 means no health check.\nhealth_check_period = 2 \n\n# Health check user\nhealth_check_user = \'su\'\n\n# Execute command by failover.\n# special values: %d = node id\n# %h = host name\n# %p = port number\n# %D = database cluster path\n# %m = new master node id\n# %M = old master node id\n# %% = \'%\' character\n#\nfailover_command = \'\'\n\n# Execute command by failback.\n# special values: %d = node id\n# %h = host name\n# %p = port number\n# %D = database cluster path\n# %m = new master node id\n# %M = old master node id\n# %% = \'%\' character\n#\nfailback_command = \'\'\n\n# If true, automatically lock table with INSERT statements to keep SERIAL\n# data consistency. An /*INSERT LOCK*/ comment has the same effect. A\n# /NO INSERT LOCK*/ comment disables the effect.\ninsert_lock = false\n\n# If true, ignore leading white spaces of each query while pgpool judges\n# whether the query is a SELECT so that it can be load balanced. This\n# is useful for certain APIs such as DBI/DBD which is known to adding an\n# extra leading white space.\nignore_leading_white_space = true\n\n# If true, print all statements to the log. Like the log_statement option\n# to PostgreSQL, this allows for observing queries without engaging in full\n# debugging.\nlog_statement = false\n\n# If true, incoming connections will be printed to the log.\nlog_connections = true\n\n# If true, hostname will be shown in ps status. Also shown in\n# connection log if log_connections = true.\n# Be warned that this feature will add overhead to look up hostname.\nlog_hostname = false\n\n# if non 0 , run in parallel query mode\nparallel_mode = false\n\n# if non 0 , use query cache\nenable_query_cache = false\n\n#set pgpool2 hostname\npgpool2_hostname = \'host2\'\n\n# system DB info\nsystem_db_hostname = \'localhost\'\nsystem_db_port = 5432 \nsystem_db_dbname = \'pgpool\'\nsystem_db_schema = \'pgpool_catalog\'\nsystem_db_user = \'pgpool\'\nsystem_db_password = \'\'\n\n# backend_hostname, backend_port, backend_weight\n# here are examples\nbackend_hostname0 = \'localhost\'\nbackend_port0 = 5432 \nbackend_weight0 = 1 \n#backend_data_directory0 = \'/data\'\nbackend_hostname1 = \'host2\'\nbackend_port1 = 5432 \nbackend_weight1 = 1 \n#backend_data_directory1 = \'/data1\'\n\n# - HBA -\n\n# If true, use pool_hba.conf for client authentication. In pgpool-II\n# 1 . 1 , the default value is false. The default value will be true in\n# 1 . 2 .\nenable_pool_hba = false\n\n# - online recovery -\n# online recovery user\nrecovery_user = \'su\'\n\n# online recovery password\nrecovery_password = \'\'\n\n# execute a command in first stage.\nrecovery_1st_stage_command = \'\'\n\n# execute a command in second stage.\nrecovery_2nd_stage_command = \'\'\n\n# maximum time in seconds to wait for remote start-up. 0 means no wait\nrecovery_timeout = 20 \n