Reply
Explorer
Posts: 7
Registered: ‎06-27-2017

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 com.cloudera.cmf.db.host

 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?

 

 

Highlighted
Posts: 177
Topics: 8
Kudos: 27
Solutions: 19
Registered: ‎07-16-2015

Re: MySQL High Availability

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.

Explorer
Posts: 7
Registered: ‎06-27-2017

Re: MySQL High Availability

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


Thanks,

Gene

Explorer
Posts: 7
Registered: ‎06-27-2017

Re: MySQL High Availability

#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
#
# http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
#
#---------------------------------------------------------------------

#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
# 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 127.0.0.1 local2

chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon

# 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
#---------------------------------------------------------------------
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
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

#---------------------------------------------------------------------
# MySQL
#---------------------------------------------------------------------
listen mysql-cluster
bind 127.0.0.1:3306
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

Announcements