<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="DISCONNECT"</div><div>node b \</div><div><span style="white-space:pre-wrap">       </span>attributes pgsql-data-status="DISCONNECT"</div>
<div>node c \</div><div><span style="white-space:pre-wrap">   </span>attributes pgsql-data-status="DISCONNECT"</div><div>primitive pgsql ocf:heartbeat:pgsql \</div><div><span style="white-space:pre-wrap">  </span>params pgctl="/usr/lib/postgresql/9.3/bin/pg_ctl" psql="/usr/bin/psql" pgdata="/var/lib/postgresql/9.3/main" start_opt="-p 5432" rep_mode="sync" node_list="a b c" restore_command="cp /var/lib/postgresql/9.3/pg_archive/%f %p" master_ip="192.168.10.200" restart_on_promote="true" config="/etc/postgresql/9.3/main/postgresql.conf" \</div>
<div><span style="white-space:pre-wrap">  </span>op start interval="0s" timeout="60s" on-fail="restart" \</div><div><span style="white-space:pre-wrap">   </span>op monitor interval="4s" timeout="60s" on-fail="restart" \</div>
<div><span style="white-space:pre-wrap">  </span>op monitor interval="3s" role="Master" timeout="60s" on-fail="restart" \</div><div><span style="white-space:pre-wrap"> </span>op promote interval="0s" timeout="60s" on-fail="restart" \</div>
<div><span style="white-space:pre-wrap">  </span>op demote interval="0s" timeout="60s" on-fail="stop" \</div><div><span style="white-space:pre-wrap">     </span>op stop interval="0s" timeout="60s" on-fail="block" \</div>
<div><span style="white-space:pre-wrap">  </span>op notify interval="0s" timeout="60s"</div><div>primitive pgsql-master-ip ocf:heartbeat:IPaddr2 \</div><div><span style="white-space:pre-wrap">        </span>params ip="192.168.10.200" nic="peervpn0" \</div>
<div><span style="white-space:pre-wrap">  </span>op start interval="0s" timeout="60s" on-fail="restart" \</div><div><span style="white-space:pre-wrap">   </span>op monitor interval="10s" timeout="60s" on-fail="restart" \</div>
<div><span style="white-space:pre-wrap">  </span>op stop interval="0s" timeout="60s" on-fail="block"</div><div>group master pgsql-master-ip</div><div>ms msPostgresql pgsql \</div><div><span style="white-space:pre-wrap">       </span>meta master-max="1" master-node-max="1" clone-max="3" clone-node-max="1" notify="true"</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="cib-bootstrap-options" \</div>
<div><span style="white-space:pre-wrap">  </span>dc-version="1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff" \</div><div><span style="white-space:pre-wrap">  </span>cluster-infrastructure="openais" \</div>
<div><span style="white-space:pre-wrap">  </span>expected-quorum-votes="3" \</div><div><span style="white-space:pre-wrap">    </span>no-quorum-policy="ignore" \</div><div><span style="white-space:pre-wrap">    </span>stonith-enabled="false" \</div>
<div><span style="white-space:pre-wrap">  </span>crmd-transition-delay="0" \</div><div><span style="white-space:pre-wrap">    </span>last-lrm-refresh="1386404222"</div><div>rsc_defaults $id="rsc-options" \</div>
<div><span style="white-space:pre-wrap">  </span>resource-stickiness="100" \</div><div><span style="white-space:pre-wrap">    </span>migration-threshold="1"</div><div><br></div></div></div><div><br></div></div>