Ask Your Question

Build MySQL HA on openstack

asked 2013-07-09 02:26:45 -0500

anonymous user


updated 2013-07-09 20:46:14 -0500

Hello All:

We have deployed the MySQL HA successfully at two physical computer.

Then we try to deploy the MySQL HA in the same method at two VMs on openstack, but we got some trouble.

The two VMs can be synchronized and created virtual ip , but the same domain VMs can not get response from virtual ip through 'ping' command .

Could you give me some advice ?

We report related configure files, as list below:

======crm configure=========

node host1.localdomain

node host2.localdomain

primitive p_drbd_mysql ocf:linbit:drbd \

params drbd_resource="clusterdb_res" \

op monitor interval="15s"

primitive p_fs_mysql ocf:heartbeat:Filesystem \

params device="/dev/drbd0" directory="/var/lib/mysql_drbd" fstype="ext4"

primitive p_ip_mysql ocf:heartbeat:IPaddr2 \

params ip="" cidr_netmask="25" nic="eth0"

primitive p_mysql ocf:heartbeat:mysql \

params binary="/usr/sbin/mysqld" config="/var/lib/mysql_drbd/my.cnf" datadir="/var/lib/mysql_drbd/data" pid="/var/lib/mysql/" socket="/var/lib/mysql/mysql.sock" user="billy" group="billy" additional_parameters="--bind-address= --user=billy" \

op start interval="0" timeout="120s" \

op stop interval="0" timeout="120s" \

op monitor interval="20s" timeout="30s"

primitive p_ping ocf:pacemaker:ping \

params name="ping" multiplier="1000" host_list="" \

op monitor interval="15s" timeout="60s" start

group g_mysql p_fs_mysql p_ip_mysql p_mysql

ms ms_drbd_mysql p_drbd_mysql \

meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true"

clone cl_ping p_ping \

meta interleave="true"

location cli-prefer-g_mysql g_mysql \

rule $id="cli-prefer-rule-g_mysql" inf: #uname eq host1.localdomain

location l_drbd_master_on_ping ms_drbd_mysql \

rule $id="l_drbd_master_on_ping-rule" $role="Master" -inf: not_defined ping or ping number:lte 0

colocation c_mysql_on_drbd inf: g_mysql ms_drbd_mysql:Master

order o_drbd_before_mysql inf: ms_drbd_mysql:promote g_mysql:start

property $id="cib-bootstrap-options" \

dc-version="1.1.8-7.el6-394e906" \

cluster-infrastructure="classic openais (with plugin)" \

expected-quorum-votes="2" \

no-quorum-policy="ignore" \


rsc_defaults $id="rsc-options" \



compatibility: whitetank

totem {

version: 2

secauth: off

threads: 0

interface {

ringnumber: 0



mcastport: 4000

ttl: 1



logging {

fileline: off

to_stderr: no

to_logfile: yes

to_syslog: yes

logfile: /var/log/cluster/corosync.log

debug: off

timestamp: on

logger_subsys {

subsys: AMF

debug: off



amf {

mode: disabled



service {

name: pacemaker

ver: 1



resource clusterdb_res {

protocol C;

handlers {

pri-on-incon-degr "/usr/lib/drbd/; /usr/lib/drbd/; echo b > /proc/sysrq-trigger; reboot -f";

pri-lost-after-sb "/usr/lib/drbd/; /usr/lib/drbd/; echo b > /proc/sysrq-trigger; reboot -f";

local-io-error "/usr/lib/drbd/; /usr/lib/drbd/; echo o > /proc/sysrq-trigger; halt -f";


startup {

degr-wfc-timeout 120;

outdated-wfc-timeout 2;


disk {

on-io-error detach;


net {

cram-hmac-alg "sha1";

shared-secret "clusterdb";

after-sb-0pri disconnect;

after-sb-1pri disconnect;

after-sb-2pri disconnect;

rr-conflict disconnect;


syncer {

rate 100M;

al-extents 257;

on-no-data-accessible io-error;


on host1.localdomain {

device /dev/drbd0;

disk /dev/vda3;


flexible-meta-disk internal;


on host2.localdomain {

device /dev/drbd0;

disk /dev/vda3;


meta-disk internal; } }

Thanks in advance.

BR, ehung lu

edit retag flag offensive close merge delete


it's not clear to me what you're trying to do. I suggest you not to post the configuration files here (it makes it hard to read the message -use and link here) and be more verbose about the openstack-related part of the problems.

smaffulli gravatar imagesmaffulli ( 2013-07-12 18:48:34 -0500 )edit

are you trying to deply mysql HA on instances?

medhat gravatar imagemedhat ( 2013-08-23 22:26:15 -0500 )edit


I am also planning to have a similar setup in my openstack environment. Could you please tell me how did you configured virtual IP in your instances? gravatar ( 2014-07-15 21:01:18 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-10-02 21:42:37 -0500

jtaguinerd gravatar image

Check security group first. See if icmp is allowed. Make sure to allow also all the other ports you are using. You need to reserve the fixed ip you used for VIP in nova, so that the next time you launch instance it will not get assigned.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools


Asked: 2013-07-09 02:26:45 -0500

Seen: 591 times

Last updated: Jul 09 '13