[pgpool-general: 3303] Re: Weight

Tatsuo Ishii ishii at postgresql.org
Mon Nov 24 14:44:24 JST 2014


Well I think the real problem here is, the configuration of weight is
bound to physical node. Ideally the weight should be bound to the
"logical" or "role" of the node: primary (master) or standbye (slave).
This way, you don't need to change the weight parameter after role of
the nodes are swapped. What do you think?

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

> Hello,
> 
> This method works well, but doesn't really play nicely with our use of
> Puppet (which manages the config files).
> 
> Would anyone support looking into a pcp command to change this? I may have
> some time early in the new year to have a go at an implementation.
> 
> I was thinking a very simple:
> 
> pcp_node_weight timeout hostname port# username password nodeID newweight
> 
> Maybe there is a reason this won't work / isn't a good idea though?
> 
> Cheers,
> 
> 
> 
> 
> 
> 
> James Sewell,
> PostgreSQL Team Lead / Solutions Architect
> ______________________________________
> 
> 
>  Level 2, 50 Queen St, Melbourne VIC 3000
> 
> *P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099
> 
> 
> On Tue, Jul 15, 2014 at 5:38 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:
> 
>> > Hey All,
>> >
>> > I have two nodes setup like so:
>> >
>> >    - Node 1: Master, weight 0
>> >    - Node 2: Slave, weight 1
>> >
>> > This allows me to send all writes to the master and all reads to the
>> slave.
>> >
>> > At some stage I promote the slave to be the new master (pcp_promote with
>> > DISALLOW_TO_FAILOVER), then at some stage later re-provision the master
>> as
>> > a new slave and re-connect it (pcp_enable)
>> >
>> > I now have the following setup:
>> >
>> >    - Node 1: Slave, weight 0
>> >    - Node 2: Master, weight 1
>> >
>> > This means that all write and read queries are serviced by the new
>> master,
>> > and none by the new slave.
>> >
>> > Is there a way around this? If there isn't currently could a pcp command
>> be
>> > implemented which would allow me to manage my own weights?
>>
>> You could change weight parameters in pgpool.conf then reload it.
>>
>> Best regards,
>> --
>> Tatsuo Ishii
>> SRA OSS, Inc. Japan
>> English: http://www.sraoss.co.jp/index_en.php
>> Japanese:http://www.sraoss.co.jp
>>
>> > Cheers,
>> >
>> >
>> >
>> > James Sewell,
>> > PostgreSQL Team Lead / Solutions Architect
>> > ______________________________________
>> >
>> >
>> >  Level 2, 50 Queen St, Melbourne VIC 3000
>> >
>> > *P *(+61) 3 8370 8000  *W* www.lisasoft.com  *F *(+61) 3 8370 8099
>> >
>> > --
>> >
>> >
>> > ------------------------------
>> > The contents of this email are confidential and may be subject to legal
>> or
>> > professional privilege and copyright. No representation is made that this
>> > email is free of viruses or other defects. If you have received this
>> > communication in error, you may not copy or distribute any part of it or
>> > otherwise disclose its contents to anyone. Please advise the sender of
>> your
>> > incorrect receipt of this correspondence.
>>
> 
> -- 
> 
> 
> ------------------------------
> The contents of this email are confidential and may be subject to legal or 
> professional privilege and copyright. No representation is made that this 
> email is free of viruses or other defects. If you have received this 
> communication in error, you may not copy or distribute any part of it or 
> otherwise disclose its contents to anyone. Please advise the sender of your 
> incorrect receipt of this correspondence.


More information about the pgpool-general mailing list