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

Brandon Chapman webeindustry at gmail.com
Wed Nov 16 07:17:46 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.


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linbit.com/pipermail/drbd-user/attachments/20161116/531db2af/attachment.htm>


More information about the drbd-user mailing list