[pgpool-general: 4221] Re: Working wiht pgpool and one master and one slave

Tatsuo Ishii ishii at postgresql.org
Wed Nov 18 07:54:35 JST 2015


> Hello,
> 
> 
> 
> 2015-11-16 20:25 GMT-02:00 Tatsuo Ishii <ishii at postgresql.org>:
> 
>> > Hello,
>> >
>> > Could you help me?
>> >
>> > I have one master and one slave in my environment. I configured my
>> > pgpool.conf such as below:
>> >
>> > listen_addresses = '*'
>> >
>> > port = 9999
>> >
>> > backend_hostname0 = master'
>> > backend_port0 = 5432
>> > backend_weight0 = 0
>> > backend_data_directory0 = '/tmp/data/'
>> >
>> > backend_hostname1 = 'slave'
>> > backend_port1 = 5432
>> > backend_weight1 = 1
>> > backend_data_directory1 = '/tmp/data'
>> >
>> > load_balance_mode = on
>> >
>> > My target is: SELECT queries should be sent to the slave server and
>> another
>> > operations to the master server.
>> >
>> > How I can simulated connections to the slave server?
>>
>> You should set:
>>
>> backend_weight0 = 0
>> backend_weight1 = 1
>>
> 
> ​Thanks for answering, but unfortunately I couldn't simulate these
> operations using psql. Is it possible to simulate this situation using psql
> client?​

Can you please elaborate more? I don't understand what is the objective
of "simulate". If you want to make sure that SELECT queries go to
slave server, you could look at the PostgreSQL statement log at the
slave server. I'm confused.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list