<div dir="ltr">Hi<div><br></div><div>I have 3 node postgresql cluster.</div><div>It work well. But I have some trobule with change master.</div><div><br></div><div>For now, if I need change master, I must:</div><div>1) Stop PGSQL on each node and cluster service</div>
<div>2) Start Setup new manual PGSQL replication</div><div>3) Change attributes on each node for point to new master</div><div>4) Stop PGSQL on each node</div><div>5) Celanup resource and start cluster service</div><div><br>
</div><div>It take a lot of time. Is it exist better way to change master?</div><div><br></div><div><br></div><div><br></div><div>This is my cluster service status:</div><div><div>Node Attributes:</div><div>* Node <a href="http://a.geocluster.e-autopay.com">a.geocluster.e-autopay.com</a>:</div>
<div>    + master-pgsql:0                  <span class="" style="white-space:pre">        </span>: 1000      </div><div>    + pgsql-data-status               <span class="" style="white-space:pre">        </span>: LATEST    </div><div>
    + pgsql-master-baseline           <span class="" style="white-space:pre">        </span>: 000000002F000090</div><div>    + pgsql-status                    <span class="" style="white-space:pre">        </span>: PRI       </div><div>
* Node <a href="http://c.geocluster.e-autopay.com">c.geocluster.e-autopay.com</a>:</div><div>    + master-pgsql:0                  <span class="" style="white-space:pre">        </span>: 1000      </div><div>    + pgsql-data-status               <span class="" style="white-space:pre">        </span>: SYNC      </div>
<div>    + pgsql-status                    <span class="" style="white-space:pre">        </span>: STOP      </div><div>* Node <a href="http://b.geocluster.e-autopay.com">b.geocluster.e-autopay.com</a>:</div><div>    + master-pgsql:0                  <span class="" style="white-space:pre">        </span>: 1000      </div>
<div>    + pgsql-data-status               <span class="" style="white-space:pre">        </span>: SYNC      </div><div>    + pgsql-status                    <span class="" style="white-space:pre">        </span>: STOP    </div></div><div>
<br></div><div><div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif">I was use <a href="http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster" target="_blank" style="font-size:small;line-height:normal">http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster</a> for my 3 nodes cluster without hard stik.</div>
<div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif">Now I got strange situation all nodes stay slave:</div><div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif">
<div>============</div><div>Last updated: Sat Dec  7 04:33:47 2013</div><div>Last change: Sat Dec  7 12:56:23 2013 via crmd on a</div><div>Stack: openais</div><div>Current DC: c - partition with quorum</div><div>Version: 1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff</div>
<div>5 Nodes configured, 3 expected votes</div><div>4 Resources configured.</div><div>============</div><div><br></div><div>Online: [ a c b ]</div><div><br></div><div> Master/Slave Set: msPostgresql [pgsql]</div><div>     Slaves: [ a c b ]</div>
</div><div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif"><br></div><div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif">My config is:</div><div style="font-size:18.095239639282227px;line-height:20px;font-family:arial,sans-serif">
<div>node a \</div><div><span style="white-space:pre-wrap">        </span>attributes pgsql-data-status=&quot;DISCONNECT&quot;</div><div>node b \</div><div><span style="white-space:pre-wrap">        </span>attributes pgsql-data-status=&quot;DISCONNECT&quot;</div>
<div>node c \</div><div><span style="white-space:pre-wrap">        </span>attributes pgsql-data-status=&quot;DISCONNECT&quot;</div><div>primitive pgsql ocf:heartbeat:pgsql \</div><div><span style="white-space:pre-wrap">        </span>params pgctl=&quot;/usr/lib/postgresql/9.3/bin/pg_ctl&quot; psql=&quot;/usr/bin/psql&quot; pgdata=&quot;/var/lib/postgresql/9.3/main&quot; start_opt=&quot;-p 5432&quot; rep_mode=&quot;sync&quot; node_list=&quot;a b c&quot; restore_command=&quot;cp /var/lib/postgresql/9.3/pg_archive/%f %p&quot; master_ip=&quot;192.168.10.200&quot; restart_on_promote=&quot;true&quot; config=&quot;/etc/postgresql/9.3/main/postgresql.conf&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op start interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div><div><span style="white-space:pre-wrap">        </span>op monitor interval=&quot;4s&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op monitor interval=&quot;3s&quot; role=&quot;Master&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div><div><span style="white-space:pre-wrap">        </span>op promote interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op demote interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;stop&quot; \</div><div><span style="white-space:pre-wrap">        </span>op stop interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;block&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op notify interval=&quot;0s&quot; timeout=&quot;60s&quot;</div><div>primitive pgsql-master-ip ocf:heartbeat:IPaddr2 \</div><div><span style="white-space:pre-wrap">        </span>params ip=&quot;192.168.10.200&quot; nic=&quot;peervpn0&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op start interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div><div><span style="white-space:pre-wrap">        </span>op monitor interval=&quot;10s&quot; timeout=&quot;60s&quot; on-fail=&quot;restart&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>op stop interval=&quot;0s&quot; timeout=&quot;60s&quot; on-fail=&quot;block&quot;</div><div>group master pgsql-master-ip</div><div>ms msPostgresql pgsql \</div><div><span style="white-space:pre-wrap">        </span>meta master-max=&quot;1&quot; master-node-max=&quot;1&quot; clone-max=&quot;3&quot; clone-node-max=&quot;1&quot; notify=&quot;true&quot;</div>
<div>colocation set_ip inf: master msPostgresql:Master</div><div>order ip_down 0: msPostgresql:demote master:stop symmetrical=false</div><div>order ip_up 0: msPostgresql:promote master:start symmetrical=false</div><div>property $id=&quot;cib-bootstrap-options&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>dc-version=&quot;1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff&quot; \</div><div><span style="white-space:pre-wrap">        </span>cluster-infrastructure=&quot;openais&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>expected-quorum-votes=&quot;3&quot; \</div><div><span style="white-space:pre-wrap">        </span>no-quorum-policy=&quot;ignore&quot; \</div><div><span style="white-space:pre-wrap">        </span>stonith-enabled=&quot;false&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>crmd-transition-delay=&quot;0&quot; \</div><div><span style="white-space:pre-wrap">        </span>last-lrm-refresh=&quot;1386404222&quot;</div><div>rsc_defaults $id=&quot;rsc-options&quot; \</div>
<div><span style="white-space:pre-wrap">        </span>resource-stickiness=&quot;100&quot; \</div><div><span style="white-space:pre-wrap">        </span>migration-threshold=&quot;1&quot;</div><div><br></div></div></div><div><br></div></div>