<div dir="ltr">try with this constrains<br><br>colocation col_postgresql inf: postgresql_cluster ms_drbd_postgresql:Master<br>order or_postgresql inf: ms_drbd_postgresql:promote postgresql_cluster:start<br><br></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/10/11 Thomaz Luiz Santos <span dir="ltr"><<a href="mailto:thomaz.santos@gmail.com" target="_blank">thomaz.santos@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Dear all!<div><br></div><div><div>I'm trying to make a sample cluster, in virtual machine, and after migrate to a physical machine, however i have problems to configure the pacemaker ( crm ), to startup the resources and failover.</div>
<div><br></div><div>I cant mount the device /dev/drbd0 in the primary node and start postgresql manually, but use in crm resource, dont can mount the device, and start de postgresql.<br></div><div><br></div><div><br></div>
<div><br></div><div>DRBD Version: 8.3.11 (api:88)</div><div><div>Corosync Cluster Engine, version '1.4.2'<br></div><div>Pacemaker 1.1.6<br></div></div><div><br></div><div><br></div><div><br></div><div>**** that is my configure on crm ****</div>
<div><br></div><div><div>crm(live)# configure</div><div>crm(live)configure# show</div><div>node ha-master</div><div>node ha-slave</div><div>primitive drbd_postgresql ocf:heartbeat:drbd \</div><div> params drbd_resource="postgresql"</div>
<div>primitive fs_postgresql ocf:heartbeat:Filesystem \</div><div> params device="/dev/drbd0" directory="/mnt" fstype="ext4" \</div><div> meta target-role="Started"</div>
<div>primitive postgresql lsb:postgresql \</div><div> meta target-role="Started"</div><div>primitive vip_cluster ocf:heartbeat:IPaddr2 \</div><div> params ip="172.70.65.200" nic="eth0:1" \</div>
<div> meta target-role="Started"</div><div>group postgresql_cluster fs_postgresql vip_cluster postgresql</div><div>ms ms_drbd_postgresql drbd_postgresql \</div><div> meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" target-role="Stopped"</div>
<div>colocation col_postgresql inf: postgresql_cluster ms_drbd_postgresql</div><div>order or_postgresql inf: ms_drbd_postgresql postgresql_cluster</div><div>property $id="cib-bootstrap-options" \</div><div> dc-version="1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c" \</div>
<div> cluster-infrastructure="openais" \</div><div> expected-quorum-votes="2" \</div><div> stonith-enabled="false" \</div><div> no-quorum-policy="ignore"</div>
<div>rsc_defaults $id="rsc-options" \</div><div> resource-stickiness="100"</div><div><br></div><div><br></div><div>**** that is my global_common on drbd **** </div><div><br></div><div><div>global {</div>
<div> usage-count yes;</div><div> # minor-count dialog-refresh disable-ip-verification</div><div>}</div><div><br></div><div>common {</div><div> protocol C;</div><div><br></div><div> handlers {</div>
<div> pri-on-incon-degr "/usr/lib/drbd/notify-pri-on-incon-degr.sh; /usr/lib/drbd/not ify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";</div>
<div> pri-lost-after-sb "/usr/lib/drbd/notify-pri-lost-after-sb.sh; /usr/lib/drbd/not ify-emergency-reboot.sh; echo b > /proc/sysrq-trigger ; reboot -f";</div>
<div> local-io-error "/usr/lib/drbd/notify-io-error.sh; /usr/lib/drbd/notify-emergenc y-shutdown.sh; echo o > /proc/sysrq-trigger ; halt -f";</div>
<div> fence-peer "/usr/lib/drbd/crm-fence-peer.sh";</div><div> after-resync-target "/usr/lib/drbd/crm-unfence-peer.sh";</div><div> # split-brain "/usr/lib/drbd/notify-split-brain.sh root";</div>
<div> # out-of-sync "/usr/lib/drbd/notify-out-of-sync.sh root";</div><div> # before-resync-target "/usr/lib/drbd/snapshot-resync-target-lvm.sh -p 15 -- -c 16k";</div>
<div> # after-resync-target /usr/lib/drbd/unsnapshot-resync-target-lvm.sh;</div><div> }</div><div><br></div><div> startup {</div><div> # wfc-timeout 15;</div><div> # degr-wfc-timeout 60;</div>
<div> # outdated-wfc-timeout wait-after-sb</div><div> }</div><div><br></div><div> disk {</div><div> # on-io-error fencing use-bmbv no-disk-barrier no-disk-flushes</div><div> # no-disk-drain no-md-flushes max-bio-bvecs</div>
<div> }</div><div><br></div><div> net {</div><div> # cram-hmac-alg sha1;</div><div> # shared-secret "secret";</div><div> # sndbuf-size rcvbuf-size timeout connect-int ping-int ping-timeout max-buffers</div>
<div> # max-epoch-size ko-count allow-two-primaries cram-hmac-alg shared-secret</div><div> # after-sb-0pri after-sb-1pri after-sb-2pri data-integrity-alg no-tcp-cork</div><div> }</div>
<div><br></div><div> syncer {</div><div> # rate 150M;</div><div> # rate after al-extents use-rle cpu-mask verify-alg csums-alg</div><div> }</div><div>}</div></div><div><br></div>
<div><br></div><div>**** that is my postgresql.res ****</div><div><br></div><div><div>resource postgresql {</div><div> startup {</div><div> wfc-timeout 15;</div><div> degr-wfc-timeout 60;</div><div> }</div><div><br>
</div><div> syncer {</div><div> rate 150M;</div><div> verify-alg md5;</div><div> }</div><div><br></div><div> disk {</div><div> on-io-error detach;</div><div> no-disk-barrier;</div><div> no-disk-flushes;</div>
<div> no-disk-drain;</div><div> fencing resource-only;</div><div> }</div><div><br></div><div> on ha-master {</div><div> device /dev/drbd0;</div><div> disk /dev/sdb1;</div><div> address <a href="http://172.70.65.210:7788" target="_blank">172.70.65.210:7788</a>;</div>
<div> meta-disk internal;</div><div> }</div><div><br></div><div> on ha-slave {</div><div> device /dev/drbd0;</div><div> disk /dev/sdb1;</div><div> address <a href="http://172.70.65.220:7788" target="_blank">172.70.65.220:7788</a>;</div>
<div> meta-disk internal;</div><div> }</div><div><br></div><div><br></div><div>}</div></div><div><br></div><div><br></div><div>**** that is my corosync.conf ****</div><div><br></div><div><div><br></div><div>compatibility: whitetank</div>
<div><br></div><div>totem {</div><div> version: 2</div><div> secauth: off</div><div> threads: 0</div><div> interface {</div><div> ringnumber: 0</div><div> bindnetaddr: 172.70.65.200</div>
<div> mcastaddr: 226.94.1.1</div><div> mcastport: 5405</div><div> ttl: 1</div><div> }</div><div>}</div><div><br></div><div>logging {</div><div> fileline: off</div>
<div> to_stderr: yes</div><div> to_logfile: yes</div><div> to_syslog: yes</div><div> logfile: /var/log/cluster/corosync.log</div><div> debug: on</div><div> timestamp: on</div><div>
logger_subsys {</div><div> subsys: AMF</div><div> debug: off</div><div> }</div><div>}</div><div><br></div><div>amf {</div><div> mode: disabled</div><div>}</div><div><br>
</div><div>aisexec{</div><div> user : root</div><div> group : root</div><div>}</div><div><br></div><div>service{</div><div> # Load the Pacemaker Cluster Resource Manager</div><div> name : pacemaker</div><div> ver : 0</div>
<div>}</div></div><div><br></div><div><br></div><div><br></div><div>DRBD, postgresql, manually start :</div><div><br></div><div><div><br></div><div>version: 8.3.13 (api:88/proto:86-96)</div><div>srcversion: 697DE8B1973B1D8914F04DB</div>
<div> 0: cs:Connected ro:Primary/Secondary ds:UpToDate/UpToDate C r-----</div><div> ns:0 nr:0 dw:0 dr:664 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:n oos:0</div></div><div><br></div><div><br></div><div><div>version: 8.3.13 (api:88/proto:86-96)</div>
<div>srcversion: 697DE8B1973B1D8914F04DB</div><div> 0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r-----</div><div> ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:n oos:0</div></div><div><br></div>
<div><br></div><div><br></div><div><div>root@ha-master:/mnt# df -hT</div><div>Sist. Arq. Tipo Tam. Usado Disp. Uso% Montado em</div><div>/dev/sda1 ext4 4,0G 1,8G 2,1G 47% /</div><div>udev devtmpfs 473M 4,0K 473M 1% /dev</div>
<div>tmpfs tmpfs 193M 264K 193M 1% /run</div><div>none tmpfs 5,0M 4,0K 5,0M 1% /run/lock</div><div>none tmpfs 482M 17M 466M 4% /run/shm</div><div>/dev/drbd0 ext4 2,0G 69M 1,9G 4% /mnt</div>
</div><div><br></div><div><br></div><div><div>root@ha-master:/mnt# service postgresql status</div><div>Running clusters: 9.1/main</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div><br>
</div><div><br></div>-- <br>------------------------------<br>
Thomaz Luiz Santos<br>Linux User: #359356<br><br></font></span></div></div></div>
<br>_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>esta es mi vida e me la vivo hasta que dios quiera
</div>