[Pacemaker] MySQL/PostgreSQL HA cluster with Pacemaker

Andrew nitr0 at seti.kr.ua
Fri Nov 2 08:06:33 UTC 2012


Hi.
Thanks for config, but is there a possibility to avoid DRBD usage for 
postgres? DB on top of DRBD may be broken if master fails at DB write 
(because write isn't atomic process).

On 01/11/12 23:40, Denny Schierz wrote:
> hi,
>
> one example config from my testcases:
>
> =================
> primitive drbd-mysql ocf:linbit:drbd \
>          params drbd_resource="mysql" \
>          operations $id="drbd-mysql-operations" \
>          op monitor start-delay="0" interval="31" \
>          meta is-managed="true"
> primitive drbd-postgres ocf:linbit:drbd \
>          params drbd_resource="postgres" \
>          operations $id="drbd-postgres-operations" \
>          op monitor start-delay="0" interval="31" \
>          meta is-managed="true"
> primitive mysql-fs ocf:heartbeat:Filesystem \
>          params device="/dev/drbd1" directory="/var/lib/mysql" fstype="ext4" \
>          meta is-managed="true" target-role="started"
> primitive mysql-ip ocf:heartbeat:IPaddr2 \
>          params ip="192.168.1.10" nic="eth0" cidr_netmask="25" \
>          operations $id="mysql-ip-operations" \
>          op monitor start-delay="0" interval="10" \
>          meta is-managed="true" target-role="started"
> primitive mysqld lsb:mysql \
>          meta is-managed="true" target-role="started"
> primitive pingd ocf:pacemaker:ping \
>          params host_list="192.168.1.254" multiplier="1000" \
>          op monitor interval="15s" timeout="20s" \
>          op start interval="0" timeout="90s" \
>          op stop interval="0" timeout="100s"
> primitive postgres-fs ocf:heartbeat:Filesystem \
>          params device="/dev/drbd0" directory="/var/lib/postgresql" fstype="ext4"
> primitive postgres-ip ocf:heartbeat:IPaddr2 \
>          params ip="192.168.1.11" nic="eth0" cidr_netmask="25" \
>          op monitor interval="10s"
> primitive postgresql ocf:heartbeat:pgsql \
>          params pgctl="/usr/lib/postgresql/9.1/bin/pg_ctl" psql="/usr/lib/postgresql/9.1/bin/psql" pgdata="/var/lib/postgresql/9.1/main/" logfile="/var/log/postgresql/postgresql-9.1-main.log" \
>          op monitor interval="30" timeout="30" depth="0"
> group mysql mysql-fs mysql-ip mysqld
> group postgres postgres-fs postgres-ip postgresql
> ms ms-drbd-mysql drbd-mysql \
>          meta clone-max="2" notify="true"
> ms ms-drbd-postgres drbd-postgres \
>          meta clone-max="2" notify="true"
> clone pingdclone pingd \
>          meta globally-unique="false" interleave="true"
> location cli-prefer-mysql mysql \
>          rule $id="cli-prefer-rule-mysql" inf: #uname eq SQLNODE-01
> location mysql-cluster-on-connected-node mysql \
>          rule $id="mysql-cluster-on-connected-node-rule" -inf: not_defined pingd or pingd lte 0
> location postgres-cluster-on-connected-node postgres \
>          rule $id="postgres-cluster-on-connected-node-rule" -inf: not_defined pingd or pingd lte 0
> colocation mysql_on_drbd inf: mysql ms-drbd-mysql:Master
> colocation postgres_on_drbd inf: postgres ms-drbd-postgres:Master
> order mysql-after-drbd inf: ms-drbd-mysql:promote mysql:start
> order postgres-after-drbd inf: ms-drbd-postgres:promote postgres:start
> property $id="cib-bootstrap-options" \
>          default-resource-stickiness="1" \
>          expected-quorum-votes="2" \
>          stonith-enabled="false" \
>          dc-version="1.1.7-ee0730e13d124c3d58f00016c3376a1de5323cff" \
>          no-quorum-policy="ignore" \
>          cluster-infrastructure="openais" \
>          last-lrm-refresh="1351689797"
>
> ======================
>
> only stonith is missing, that would be in my case external/vmware :-)
>
> cu denny
>





More information about the Pacemaker mailing list