Support Questions

Find answers, ask questions, and share your expertise

MySQL High Availability


Cloudera documentation identifies the steps for MySQL replication. I cannot find any information of how you set up high availabilty should the DB crash. Yes the data is replicated to another server but we are not pointing to that server.


I was told that Cloudera only supprorts the Db being Active/Passive. So how do you reference the "passive" if needed?


There are nine configurations for database hostname.

 1. Cloudera Manager

 2. Hue Database Hostname

 3. Activity Monitor Database Hostname

 4. Navigator Audit Server Database Hostname

 5. Navigator Metadata Server Database Hostname

 6. Reports Manager Database Hostname

 7. Oozie Server Database Host

 8. Hive Metastore Database Host

 9. Sentry Server Database Host


We have tried to use various load balancers (single IP) to multiple DB servers, but have found this inconsistant. Sentry fails to start. We get DB timeouts as if connection are stale and not resubmitted when the DBs failover.


Is it expected that we manually have to change nine configuration points and do service restarts? Is this the concept of high availability?




Super Collaborator

For this particular case we have used HAProxy + Keepalive.

The cluster shouldn't have to know which instance is active but your balancer need to know.


We are trying to use HAProxy. Do you care to share you haproxy.conf?




# Example configuration for a possible web application. See the
# full configuration options online.

# Global settings
# to have these messages end up in /var/log/haproxy.log you will
# need to:
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# /etc/sysconfig/syslog
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# /etc/sysconfig/syslog
# local2.* /var/log/haproxy.log
log local2

chroot /var/lib/haproxy
pidfile /var/run/
maxconn 4000
user haproxy
group haproxy

# turn on stats unix socket
stats socket /var/lib/haproxy/stats

# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1d
timeout server 1d
timeout tunnel 1d
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000

listen mysql-cluster
mode tcp
option tcpka
stick-table type ip size 1 nopurge
stick on dst
server mysql-1 mysql-1:3308 check
server mysql-2 mysql-2:3308 check backup
server mysql-3 mysql-3:3308 check backup


How You configured MySQL DB in HA . Can you tell me the steps?


We use Percona distro of MySQL for a MySQL cluster. We use Haproxy to connect to the cluster. Our actual connect is to localhost:port that Haproxy proxies to mysql:port


All of our DB connection configurations specify localhost:3306