[DRBD-user] DRBD8.4 + Corosync + MySQL

Igor Cicimov igorc at encompasscorporation.com
Thu Nov 17 00:26:32 CET 2016

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hi Brandon,

On Wed, Nov 16, 2016 at 5:17 PM, Brandon Chapman <webeindustry at gmail.com>
wrote:

> Hello.
>
> I am trying to integrate MySQL into my cluster currently setup with
> drbd8.4.5 on ubuntu16.04.1LTS.
> I have mostly followed this guide here:
>
> http://www.tokiwinter.com/clustering-with-drbd-corosync-and-pacemaker/
>
> Adapting for my environment, mainly that I am not running centos.
> I have successfully configured the resources and user agents listed in
> this guide, but need to add MySQL HA as well.
>
> This is a current result of crm configure show:
>
> node 1: alpha \
>         attributes standby=off
> node 2: beta \
>         attributes standby=on
> primitive drbd_res ocf:linbit:drbd \
>         params drbd_resource=r0 \
>         op monitor interval=29s role=Master \
>         op monitor interval=31s role=Slave
> primitive failover_ip IPaddr2 \
>         params ip=76.213.77.43 cidr_netmask=24 \
>         op monitor interval=30s
> primitive fs_res Filesystem \
>         params device="/dev/drbd0" directory="/data" fstype=ext4
> primitive nginx_res nginx \
>         params configfile="/etc/nginx/nginx.conf" httpd="/usr/sbin/nginx"
> \
>         op monitor interval=0
> ms drbd_master_slave drbd_res \
>         meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1
> notify=true
> order fs_after_drbd Mandatory: drbd_master_slave:promote fs_res:start
> colocation fs_drbd_colo inf: fs_res drbd_master_slave:Master
> order nginx_after_fs inf: fs_res nginx_res
> order nginx_after_ip Mandatory: failover_ip nginx_res
> colocation nginx_fs_colo inf: nginx_res fs_res
> colocation nginx_ip_colo inf: nginx_res failover_ip
> property cib-bootstrap-options: \
>         have-watchdog=false \
>         dc-version=1.1.14-70404b0 \
>         cluster-infrastructure=corosync \
>         cluster-name=debian \
>         stonith-enabled=false \
>         no-quorum-policy=ignore
>
> I have taken these steps so far:
>
>
> $$ apt install mysql-server -y
> $$ service mysql stop
> $$ systemctl disable mysql
> $$ sudo rsync -av /var/lib/mysql /data
> $$ nano /etc/mysql/mysql.conf.d/mysqld.cnf
>
> socket          = /data/mysql/mysqld.sock
> datadir         = /data/mysql
>
> $$  echo "alias /var/lib/mysql/ -> /data/mysql/," >>
> /etc/apparmor.d/tunables/alias
> $$ service apparmor reload
> $$ crm configure primitive mysql_res ocf:heartbeat:mysql params
> binary="/usr/sbin/mysqld" datadir="/data/mysql" socket="/data/mysql/mysqld.sock"
> op start timeout=60s op stop timeout=60s op monitor interval=15s
> $$ crm configure colocation mysql_ip_colo INFINITY: mysql_res failover_ip
> $$ crm configure order mysql_after_ip mandatory: failover_ip mysql_res
>
> This results in an initial start on the online node, but it attempts to
> start on standby as well. If I 'crm node standby' to the onine node, it
> will not start on the other node.
>
> Shows errors after bringing both nodes to standby, then bringing back
> online:
>
> https://i.imgur.com/kOmXGMn.png
>
> How can I go about solving this?
>
> _______________________________________________
> drbd-user mailing list
> drbd-user at lists.linbit.com
> http://lists.linbit.com/mailman/listinfo/drbd-user
>
> Any errors in the syslog at all?

Did you test if you can start MySQL manually as configured atm? Rule of
thumb, ALWAYS confirm the service can be started manually first before you
go with the cluster.

The "not installed" error suggests using a wrong RA parameter or error in
the OCF agent script itself. So, first check if you have all parameters
correctly stated in the crm configure commands:

# crm ra meta ocf:heartbeat:mysql

then run the agent manually and check for errors in the ouptu of the
ocf-tester:

# ocf-tester -v -n mysql_res -o OCF_ROOT=/usr/lib/ocf -o
binary="/usr/sbin/mysqld" -o datadir="/data/mysql" -o
socket="/data/mysql/mysqld.sock" /usr/lib/ocf/resource.d/heartbeat/mysql

Cheers,
Igor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20161117/8aa1f7f1/attachment.htm>


More information about the drbd-user mailing list