[pgpool-general: 515] Re: [pgpoo-II general] Why use pgpool-II in replication mode can not createdb simultaneously to two backend postgres server

Barco You barco.you at bestv-intl.com
Sun May 27 17:52:51 JST 2012


Here is the result of command "show pool_status":

                 item                 |             value
|                           description
--------------------------------------+--------------------------------+------------------------------------------------------------------
 listen_addresses                     | *                              |
host name(s) or IP address(es) to listen to
 port                                 | 9999                           |
pgpool accepting port number
 socket_dir                           | /var/run/postgresql            |
pgpool socket directory
 num_init_children                    | 32                             | #
of children initially pre-forked
 child_life_time                      | 300                            | if
idle for this seconds, child exits
 connection_life_time                 | 0                              | if
idle for this seconds, connection closes
 client_idle_limit                    | 0                              | if
idle for this seconds, child connection closes
 child_max_connections                | 0                              | if
max_connections received, chile exits
 max_pool                             | 10                             |
max # of connection pool per child
 authentication_timeout               | 60                             |
maximum time in seconds to complete client authentication
 logdir                               | /tmp                           |
PgPool status file logging directory
 log_destination                      | stderr                         |
logging destination
 syslog_facility                      | LOCAL0                         |
syslog local faclity
 syslog_ident                         | pgpool                         |
syslog program ident string
 pid_file_name                        | /var/run/pgpool/pgpool.pid     |
path to pid file
 replication_mode                     | 1                              |
non 0 if operating in replication mode
 load_balance_mode                    | 1                              |
non 0 if operating in load balancing mode
 replication_stop_on_mismatch         | 0                              |
stop replication mode on fatal error
 failover_if_affected_tuples_mismatch | 0                              |
failover if affected tuples are mismatch
 replicate_select                     | 0                              |
non 0 if SELECT statement is replicated
 reset_query_list                     | ABORT; DISCARD ALL             |
queries issued at the end of session
 white_function_list                  |                                |
functions those do not write to database
 black_function_list                  | currval,lastval,nextval,setval |
functions those write to database
 print_timestamp                      | 1                              | if
true print time stamp to each log line
 master_slave_mode                    | 0                              | if
true, operate in master/slave mode
 master_slave_sub_mode                | stream                         |
master/slave sub mode
 sr_check_period                      | 10                             | sr
check period
 sr_check_user                        | nobody                         | sr
check user
 delay_threshold                      | 10000000                       |
standby delay threshold
 log_standby_delay                    | if_over_threshold              |
how to log standby delay
 connection_cache                     | 1                              | if
true, cache connection pool
 health_check_timeout                 | 20                             |
health check timeout
 health_check_period                  | 0                              |
health check period
 health_check_user                    | nobody                         |
health check user
 failover_command                     |                                |
failover command
 follow_master_command                |                                |
follow master command
failback_command                     |                                |
failback command
 fail_over_on_backend_error           | 1                              |
fail over on backend error
 insert_lock                          | 0                              |
insert lock
 ignore_leading_white_space           | 1                              |
ignore leading white spaces
 num_reset_queries                    | 2                              |
number of queries in reset_query_list
 pcp_port                             | 9898                           |
PCP port # to bind
 pcp_socket_dir                       | /var/run/postgresql            |
PCP socket directory
 pcp_timeout                          | 10                             |
PCP timeout for an idle client
 log_statement                        | 0                              | if
non 0, logs all SQL statements
 log_per_node_statement               | 0                              | if
non 0, logs all SQL statements on each node
 log_connections                      | 0                              | if
true, print incoming connections to the log
 log_hostname                         | 0                              | if
true, resolve hostname for ps and log print
 enable_pool_hba                      | 1                              | if
true, use pool_hba.conf for client authentication
 recovery_user                        | nobody                         |
online recovery user
 recovery_1st_stage_command           |                                |
execute a command in first stage.
 recovery_2nd_stage_command           |                                |
execute a command in second stage.
 recovery_timeout                     | 90                             |
max time in seconds to wait for the recovering node's postmaster
 client_idle_limit_in_recovery        | 0                              | if
idle for this seconds, child connection closes in recovery 2n
 lobj_lock_table                      |                                |
table name used for large object replication control
 ssl                                  | 0                              |
SSL support
 ssl_key                              |                                |
path to the SSL private key file
 ssl_cert                             |                                |
path to the SSL public certificate file
 debug_level                          | 1                              |
debug message level
 relcache_expire                      | 0                              |
relation cache expiration time in seconds
 parallel_mode                        | 0                              | if
non 0, run in parallel query mode
 enable_query_cache                   | 1                              | if
non 0, use query cache
 pgpool2_hostname                     | cms                            |
pgpool2 hostname
 system_db_hostname                   | localhost                      |
system DB hostname
 system_db_port                       | 5432                           |
system DB port number
 system_db_dbname                     | pgpool                         |
system DB name
 system_db_schema                     | pgpool_catalog                 |
system DB schema name
 system_db_user                       | pgpool                         |
user name to access system DB
 backend_hostname0                    | 10.0.3.12                      |
backend #0 hostname
 backend_port0                        | 5432                           |
backend #0 port number
 backend_weight0                      | 0.500000                       |
weight of backend #0
 backend_status0                      | 2                              |
status of backend #0
 standby_delay0                       | 0                              |
standby delay of backend #0
 backend_flag0                        | ALLOW_TO_FAILOVER              |
backend #0 flag
backend_hostname1                    | 10.0.3.186                     |
backend #1 hostname
 backend_port1                        | 5432                           |
backend #1 port number
 backend_weight1                      | 0.500000                       |
weight of backend #1
 backend_status1                      | 3                              |
status of backend #1
 standby_delay1                       | 0                              |
standby delay of backend #1
 backend_flag1                        | ALLOW_TO_FAILOVER              |
backend #1 flag


On Sun, May 27, 2012 at 4:48 PM, Barco You <barco.you at bestv-intl.com> wrote:

> Yes, it's sure that postgresql on two backends running, because I can use
> psql connect to them!
>
>
> On Sun, May 27, 2012 at 4:42 PM, Tatsuo Ishii <ishii at postgresql.org>wrote:
>
>> Are you sure that postgresql on 10.0.3.12 is running?  If so, execute
>> "show pool_status" command and check value "backend_status1". That
>> will show the status of backend1 from the point of view of pgpool.  If
>> pgpool thinks backend1 is not healthy, it does not send create
>> database command to backend1.
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese: http://www.sraoss.co.jp
>>
>> > I install pgpool-II 3.1.3 from source on machine 10.0.3.3 and I have to
>> > postgres backends (postgresql 9.1) at 10.0.3.12 and 10.0.3.186
>> respectively.
>> > I have the following configuration for the pgpool.conf.
>> >
>> > After I use "psql -h 10.0.3.3 -p 9999 -U postgres" to connect pgpool
>> from
>> > another machine I can connect correctly and I do "create database xxxxx
>> > with xxxx" successfully.
>> > But if I check the backend DB server, only one server
>> (backend_hostname0)
>> > has the databse xxxx create correctly, there is no this database at
>> > backend_hostname1.
>> >
>> > Could you please help indicate why. Thanks!
>> >
>> > backend_hostname0 = '10.0.3.12'
>> >                                    # Host name or IP address to connect
>> to
>> > for bb
>> > ackend 0
>> > backend_port0 = 5432
>> >                                    # Port number for backend 0
>> > backend_weight0 = 1
>> >                                    # Weight for backend 0 (only in load
>> > balancinn
>> > g mode)
>> > backend_data_directory0 = '/etc/postgresql/9.1/main'
>> >                                    # Data directory for backend 0
>> > backend_flag0 = 'ALLOW_TO_FAILOVER'
>> >                                    # Controls various backend behavior
>> >                                    # ALLOW_TO_FAILOVER or
>> > DISALLOW_TO_FAILOVER
>> > backend_hostname1 = '10.0.3.186'
>> > backend_port1 = 5432
>> > backend_weight1 = 1
>> > backend_data_directory1 = '/etc/postgresql/9.1/main'
>> > backend_flag1 = 'ALLOW_TO_FAILOVER'
>> >
>> > .....
>> >
>> > replication_mode = on
>> > ....
>> > load_balance_mode = on
>> >                                    # Activate load balancing mode
>> >                                    # (change requires restart)
>> > ignore_leading_white_space = on
>> >
>> >
>> > --
>> >
>> > Best regards,
>> > Barco
>>
>
>
>
> --
>
> Best regards,
> Barco
>
>


-- 

Best regards,
Barco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20120527/d50baf19/attachment-0001.html>


More information about the pgpool-general mailing list