Forge Home

galera_maxscale

Galera and MaxScale Cluster

11,837 downloads

5,807 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.3.8 (latest)
  • 0.3.7
  • 0.3.6
  • 0.3.5
  • 0.3.0
  • 0.2.1
  • 0.2.0
  • 0.1.14
  • 0.1.12
  • 0.1.11
  • 0.1.10
  • 0.1.9
  • 0.1.8
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0 (deleted)
released Jan 19th 2018
This version is compatible with:
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'maxadamo-galera_maxscale', '0.1.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add maxadamo-galera_maxscale
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install maxadamo-galera_maxscale --version 0.1.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

maxadamo/galera_maxscale — version 0.1.3 Jan 19th 2018

galera_maxscale

Table of Contents

  1. Description
  2. Setup - The basics of getting started with galera_maxscale
  3. Usage - Configuration options and additional functionality
  4. Reference - An under-the-hood peek at what the module is doing and how
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

This module sets up and bootstrap Galera cluster and MaxScale Proxy. The subsequent management of the Galera cluster is demanded to the script galera_wizard.yp. MaxScale Proxy will set up on 2 nodes with Keepalived

Setup

Beginning with galera_maxscale

To setup a galera cluster:

class { 'galera':
  root_password    => $root_password,
  sst_password     => $sst_password,
  monitor_password => $monitor_password,
  galera_hosts     => $galera_hosts,
  trusted_networks => $trusted_networks,
  lv_size          => $lv_size;
}

To setup MaxScale:

class { 'galera::maxscale::maxscale':
  trusted_networks => $trusted_networks,
  maxscale_hosts   => $maxscale_hosts,
  maxscale_vip     => $maxscale_vip,
  galera_hosts     => $galera_hosts;
}

Once you have run puppet on every node, you can manage or check the cluster using the script:

[root@test-galera01 ~]# galera_wizard.py -h
usage: galera_wizard.py [-h] [-cg] [-dr] [-je] [-be] [-jn] [-bn]

Use this script to bootstrap, join nodes within a Galera Cluster
----------------------------------------------------------------
  Avoid joining more than one node at once!

optional arguments:
  -h, --help                 show this help message and exit
  -cg, --check-galera        check if all nodes are healthy
  -dr, --dry-run             show SQL statements to run on this cluster
  -je, --join-existing       join existing Cluster
  -be, --bootstrap-existing  bootstrap existing Cluster
  -jn, --join-new            join existing Cluster
  -bn, --bootstrap-new       bootstrap new Cluster
  -f, --force                force bootstrap new or join new Cluster

Author: Massimiliano Adamo <maxadamo@gmail.com>

Usage

The module will fail with an even number of nodes, and with a number of nodes lower than 3.

To setup a Galera Cluster (and optionally a MaxScale cluster with Keepalived) we need a hash. If you use hiera it will be like this:

galera_hosts:
  test-galera01.example.net:
    ipv4: '192.168.0.83'
    ipv6: '2001:123:4::6b'
  test-galera02.example.net:
    ipv4: '192.168.0.84'
    ipv6: '2001:123:4::6c'
  test-galera03.example.net:
    ipv4: '192.168.0.85'
    ipv6: '2001:123:4::6d'
maxscale_hosts:
  test-maxscale01.example.net:
    ipv4: '192.168.0.86'
    ipv6: '2001:123:4::6e'
  test-maxscale02.example.net:
    ipv4: '192.168.0.87'
    ipv6: '2001:123:4::6f'
maxscale_vip:
  test-maxscale.example.net:
    ipv4: '192.168.0.88'
    ipv4_subnet: '22'
    ipv6: '2001:123:4::70'

If you don't use ipv6, just skip the ipv6 keys as following:

galera_hosts:
  test-galera01.example.net:
    ipv4: '192.168.0.83'
  test-galera02.example.net:
    ipv4: '192.168.0.84'
  test-galera03.example.net:
... and so on ..

you need an array of trusted networks/hosts (a list of ipv4/ipv6 networks/hosts allowed to connect to Galera socket):

trusted_networks:
  - 192.168.0.1/24
  - 2001:123:4::70/64
  - 192.168.1.44
... and so on ...

To setup a galera cluster:

class { 'galera':
  root_password    => $root_password,
  sst_password     => $sst_password,
  monitor_password => $monitor_password,
  galera_hosts     => $galera_hosts,
  trusted_networks => $trusted_networks,
  lv_size          => $lv_size;
}

To setup MaxScale:

class { 'galera::maxscale::maxscale':
  trusted_networks => $trusted_networks,
  maxscale_hosts   => $maxscale_hosts,
  maxscale_vip     => $maxscale_vip,
  galera_hosts     => $galera_hosts;
}

Reference

Limitations

  • not fully tested on ipv4 only
  • keepalived is missing configuration for ipv6
  • init.pp is missing the full list of parameters
  • not tested yet on Ubuntu

Development

Feel free to make pull requests and/or open issues on my GitHub Repository

Release Notes/Contributors/Etc. Optional