Version information
This version is compatible with:
- Debian, , , , Scientific, OracleLinux
This module has been deprecated by its author since Jul 11th 2023.
The reason given was: new maintainer
The author has suggested markt-galera as its replacement.
Start using this module
Documentation
puppet-galera module
NEWS: This is the continuation of Michael Chapman's excellent Galera module.
This module will massage puppetlabs-mysql into creating a mysql galera cluster. It will try to recover from failures by bootstrapping on a node designated as the master if no other nodes appear to be running mysql, but if the cluster goes down and the master is permanently taken out, another node will need to be specified as the 'master' that can bootstrap the cluster.
Requirements
This module depends on, at minimum, the following modules at the listed versions:
puppetlabs-mysql 3.8.0
puppetlabs-stdlib 4.1.0
# If you're on debian and need the repo to be set
puppetlabs-apt 2.0.0
# If you want the firewall to be configured for you
puppetlabs-firewall 1.0.0
# If using clustercheck
puppetlabs-xinetd 1.3.0
Structure
This module was created to work in tandem with the mysql module, rather than replacing it. As the stages in the mysql module are quite strictly laid out in the mysql::server class, this module places its own resources in the gaps between them. Of note is an exec that will start the mysql service with the parameter --wsrep_address=gcomm:// which will start a new cluster, but only if it cannot open the comms port to any other node in the provided list. This is done with a simple nc command and should not be considered terribly reliable.
Usage
Basic usage requires only the fqdn of the master node, and a list of IP addresses of other nodes:
class { 'galera':
galera_servers => ['192.168.99.101', '192.168.99.102'],
galera_master => 'control1.domain.name'
}
A number of simple options are available:
class { 'galera':
galera_servers => ['192.168.99.101', '192.168.99.102'],
galera_master => 'control1.domain.name',
vendor_type => 'mariadb', # default is 'percona'
# These options are only used for the firewall -
# to change the my.cnf settings, use the override options
# described below
$mysql_port = 3306,
$wsrep_state_transfer_port = 4444,
$wsrep_inc_state_transfer_port = 4568,
# this is used for the firewall + for status checks
# when deciding whether to bootstrap
$wsrep_group_comm_port = 4567,
local_ip => $::ipaddress_eth0, # This will be used to populate my.cnf values that control where wsrep binds, advertises, and listens
root_password => 'myrootpassword', # This will be set when the cluster is bootstrapped
configure_repo => true, # Disable this if you are managing your own repos and mirrors
configure_firewall => true, # Disable this if you don't want firewall rules to be set
}
A catch-all parameter can be used to populate my.cnf in the same way as the puppetlabs-mysql module:
class { 'galera':
galera_servers => ['192.168.99.101', '192.168.99.102'],
galera_master => 'control1.domain.name',
override_options = {
'mysqld' => {
'bind_address' => '0.0.0.0',
}
}
}
Testing
A vagrant file is provided. Control1 is set as the master and control2 as the slave. It will read environment variables for http_proxy and http_mirror, but these only work on Debian. The module has been tested on Ubuntu 12.04 and Centos 6.4, both 64 bit.
vagrant up control1
vagrant up control2
Vagrant support is currently not under active maintenance.
Contributions
Please use the github issues functionality to report any bugs or requests for new features. Feel free to fork and submit pull requests for potential contributions.
Authors
Written by Michael Chapman, currently maintained by Frank Wall.
Changelog
0.7.2
- Enhancement: Use dport parameter for puppetlabs-firewall (#59)
- Enhancement: Remove upper restriction on puppetlabs-apt (#98)
- Enhancement: Add galera_package_parameter, so we can ensure version on galera package (#100)
- Enhancement: Make bootstrap_command configurable (#101)
- Enhancement: Add possibility to purge config dir (#101)
- Enhancement: Update upper restriction on puppetlabs-mysql
- Bugfix: Use an unlisted service type instead to avoid augeas dependency (#101)
- Bugfix: Support systemd bootstrap in Ubuntu and Debian (#105)
- Bugfix: Fix mysql dependency cycle (#107)
- License: Relicense under 2-Clause BSD license (#92)
0.7.1
- Feature: Add Percona XtraDB cluster 5.6 and 5.7 support on RedHat (experimental!)
0.7.0
- WARNING: First release in almost a year, please use with caution!
- Feature: Support MySQL 5.6 and 5.7 with codership repo (#76, #86)
- Feature: Allow Tinkering with mysqlchk Logging (#79)
- Feature: Add Percona xtradb cluster 5.7 support (#85)
- Feature: Updates for MariaDB version with systemd support (#90)
- Feature: Add new parameter $create_status_user (#88)
- Feature: Allow to disable installation of additional packages (#77)
- Feature: Allow custom values for parameter $mysql_service_name (#87)
- Bugfix: Update for debian-sys-maint (#78)
- Bugfix: Update Percona key and server (#81)
- Bugfix: Fix debian-sys-maint password for Puppet 4 (#83)
- Bugfix: Drop use of host discovery in nmap probe (#84)
- Bugfix: Fix mysqlchk entry in /etc/services on CentOS (#89)
- Bugfix: Correct typo in package name (#91)
0.6.0
- Bump puppet-mysql requirement to 3.8.0
- Recent dependency cycle fixes require the latest mysql module
0.5.0
- Update README
0.4.0
- Bugfix: Fixes for problems when running on RedHat
0.3.0
- Feature: Expose create_root_user flag
0.2.0
- Bugfix: Fix service title for debian
0.1.0
- Bugfix: Additional package as an ensure_resource
Dependencies
- puppetlabs/stdlib (>= 4.1.0 < 5.0.0)
- puppetlabs/apt (>= 2.0.0 < 5.0.0)
- puppetlabs/mysql (>=5.0.0 < 7.0.0)
- puppetlabs/firewall (>=1.0.0)
- puppetlabs/xinetd (>=1.3.0)
Copyright (C) 2017-2018 Frank Wall Copyright (C) 2014-2017 Michael Chapman All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.