<html><head><title>Re: [pgpool-general: 5548] Re: Server to never assume the role of master</title>
</head>
<body>
<span style=" font-family:'Courier New'; font-size: 10pt;">Hello.<br>
<br>
Then you need to set backend_weightN=0 in pgpool.conf on this slave server. I've tried this config just now:<br>
backend_hostname0 = '172.31.13.108'<br>
backend_port0 = 5432<br>
backend_weight0 = 1<br>
backend_flag0 = 'DISALLOW_TO_FAILOVER'<br>
<br>
backend_hostname1= '172.31.0.46'<br>
backend_port1 = 5432<br>
backend_weight1 = 0<br>
backend_flag1 = 'ALLOW_TO_FAILOVER'<br>
<br>
and run pgbench &nbsp;for one minute.<br>
"show pool_nodes" reports this:<br>
 node_id | &nbsp; hostname &nbsp; &nbsp;| port | status | lb_weight | &nbsp;role &nbsp; | select_cnt | load_balance_node | replication_delay<br>
---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------<br>
 0 &nbsp; &nbsp; &nbsp; | 172.31.13.108 | 5432 | up &nbsp; &nbsp; | 1.000000 &nbsp;| primary | 5505 &nbsp; &nbsp; &nbsp; | true &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 0<br>
 1 &nbsp; &nbsp; &nbsp; | 172.31.0.46 &nbsp; | 5432 | up &nbsp; &nbsp; | 0.000000 &nbsp;| standby | 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| false &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 0<br>
(2 rows)<br>
<br>
So no queries were sent to second server.<br>
<br>
To test that load balancing is not disabled: <br>
When I change weight "backend_weight1 = 2" then i get these results:<br>
 node_id | &nbsp; hostname &nbsp; &nbsp;| port | status | lb_weight | &nbsp;role &nbsp; | select_cnt | load_balance_node | replication_delay<br>
---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------<br>
 0 &nbsp; &nbsp; &nbsp; | 172.31.13.108 | 5432 | up &nbsp; &nbsp; | 0.333333 &nbsp;| primary | 1090 &nbsp; &nbsp; &nbsp; | false &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; | 0<br>
 1 &nbsp; &nbsp; &nbsp; | 172.31.0.46 &nbsp; | 5432 | up &nbsp; &nbsp; | 0.666667 &nbsp;| standby | 4368 &nbsp; &nbsp; &nbsp; | true &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;| 0<br>
(2 rows)<br>
<br>
<br>
<br>
</span><table>
<tr>
<td width=2 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 11pt; color: #1f497d;">Hi,<br>
 <br>
Thanks for the quick reply! &nbsp;<br>
 <br>
I think it will not be that simple in my case since I want the "permanent slave" server to point to the new master when there is a failover. &nbsp;In case of a failover I want the "permanent slave" to be notified even if the other "non-permanent" slave is dead<br>
I doubt it can achieved without pgpool knowing about the permanent slave? &nbsp;<br>
 <br>
Thanks<br>
Avi<br>
 <br>
<span style=" color: #000000;"><b>From:</b> PVY [mailto:balroga3@yandex.ru] <br>
<b>Sent:</b> Thursday, June 01, 2017 2:45 PM<br>
<b>To:</b> Avi Weinberg &lt;AviW@gilat.com&gt;<br>
<b>Cc:</b> pgpool-general@pgpool.net<br>
<b>Subject:</b> Re: [pgpool-general: 5546] Server to never assume the role of master<br>
 <br>
<span style=" font-size: 10pt;">Hello, Avi.<br>
<br>
As far as I understand, if replication is configured on postgresql side, not via pgpool, then you can simply do not add this particular slave server to pgpool.conf.<br>
In this case pgpool would not know about this slave and it will never promote it or send queries to it.<br>
<br>
</span></span></span><table>
<tr>
<td width=3 bgcolor= #0000ff><br>
</td>
<td><span style=" font-family:'times new roman'; font-size: 11pt;">Hi all,<br>
<br>
I would like to have a master with two slaves setup. &nbsp;However, I want one of the servers to always be slave and never assume the role of master. &nbsp;Even more so, I would pgpool not to direct any queries to this "permanent slave" server.<br>
How do I configure pgpool / postgres to achieve this<br>
<br>
Thanks<br>
Avi<br>
<span style=" font-size: 10pt;">IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person. </td>
</tr>
</table>
<br><br>
<br>
<br>
<br>
<span style=" font-family:'times new roman'; font-size: 12pt; color: #c0c0c0;"><i>-- <br>
Best regards,<br>
PVY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></span><a style=" font-family:'times new roman'; font-size: 12pt;" href="mailto:balroga3@yandex.ru">mailto:balroga3@yandex.ru</a><br>
<span style=" font-family:'courier new'; font-size: 10pt;">IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person. </td>
</tr>
</table>
<br><br>
<br>
<br>
<span style=" font-family:'arial'; color: #c0c0c0;"><i>-- <br>
&#1057; &#1091;&#1074;&#1072;&#1078;&#1077;&#1085;&#1080;&#1077;&#1084;,<br>
 PVY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</i></span><a style=" font-family:'arial';" href="mailto:balroga3@yandex.ru">mailto:balroga3@yandex.ru</a></body></html>