<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><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><div><br>
</div><div>I reboot the virtual machines, and not have successful.</div><div>the DRBD not start the primary, and not mount the /dev/drbd0 and stard the postgresql :-( </div><div><br></div><div><br></div><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</div></div></div><div><br></div><div><br></div><div><br></div><div>**** after reboot the virtual machine. *****</div><div><br></div>
<div><div>ha-slave:</div><div><div><br></div><div>version: 8.3.13 (api:88/proto:86-96)<br></div><div>srcversion: 697DE8B1973B1D8914F04DB</div></div><div> 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----</div>
<div> ns:0 nr:28672 dw:28672 dr:0 al:0 bm:5 lo:0 pe:0 ua:0 ap:0 ep:1 wo:n oos:0</div></div><div><br></div><div><br></div><div><div>ha-master:</div><div><div>version: 8.3.13 (api:88/proto:86-96)</div><div>srcversion: 697DE8B1973B1D8914F04DB</div>
</div><div> 0: cs:Connected ro:Secondary/Secondary ds:UpToDate/UpToDate C r-----</div><div> ns:28672 nr:0 dw:0 dr:28672 al:0 bm:5 lo:0 pe:0 ua:0 ap:0 ep:1 wo:n oos:0</div></div><div><div><br></div><div><br></div><div><br>
</div><div><br></div><div><br></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><div> params device="/dev/drbd/by-res/postgresql" directory="/mnt" fstype="ext4"</div><div>primitive postgresqld lsb:postgresql</div>
<div><div>primitive vip_cluster ocf:heartbeat:IPaddr2 \</div><div> params ip="<a href="tel:172.70.65.200" value="+551727065200" target="_blank">172.70.65.200</a>" nic="eth0:1"</div></div><div>group postgresql fs_postgresql vip_cluster postgresqld \</div>
<div> meta target-role="Started"</div><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"</div>
</div><div>colocation postgresql_on_drbd inf: postgresql ms_drbd_postgresql:Master</div><div>order postgresql_after_drbd inf: ms_drbd_postgresql:promote postgresql:start</div><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><br></div></div><div><div>
crm(live)# resource</div><div>crm(live)resource# list</div><div> Master/Slave Set: ms_drbd_postgresql [drbd_postgresql]</div><div> Stopped: [ drbd_postgresql:0 drbd_postgresql:1 ]</div><div> Resource Group: postgresql</div>
<div> fs_postgresql (ocf::heartbeat:Filesystem) Stopped</div><div> vip_cluster (ocf::heartbeat:IPaddr2) Stopped</div><div> postgresqld (lsb:postgresql) Stopped</div></div><div><br></div><div>
<br></div><div><br></div><div><br></div><div><div>============</div><div>Last updated: Fri Oct 11 14:22:50 2013</div><div>Last change: Fri Oct 11 14:11:06 2013 via cibadmin on ha-slave</div><div>Stack: openais</div><div>Current DC: ha-slave - partition with quorum</div>
<div>Version: 1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c</div><div>2 Nodes configured, 2 expected votes</div><div>5 Resources configured.</div><div>============</div><div><br></div><div>Online: [ ha-slave ha-master ]</div>
<div><br></div><div><br></div><div>Failed actions:</div><div> drbd_postgresql:0_start_0 (node=ha-slave, call=14, rc=1, status=complete): unknown error</div><div> drbd_postgresql:0_start_0 (node=ha-master, call=18, rc=1, status=complete): unknown error</div>
</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div style="font-family:arial,sans-serif;font-size:13px">**** that is my global_common on drbd **** </div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><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 style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">**** that is my postgresql.res ****</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><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 style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br>
</div><div style="font-family:arial,sans-serif;font-size:13px">**** that is my corosync.conf ****</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<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: <a href="tel:172.70.65.200" value="+551727065200" target="_blank">172.70.65.200</a></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 style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px">DRBD, postgresql, manually start :</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
<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 style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><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 style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><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 style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>root@ha-master:/mnt# service postgresql status</div><div>Running clusters: 9.1/main</div>
</div><div><br></div>-- <br>------------------------------<br>Thomaz Luiz Santos<br>Linux User: #359356<br><a href="http://thomaz.santos.googlepages.com/">http://thomaz.santos.googlepages.com/</a>
</div>