Version information
This version is compatible with:
- ,
Start using this module
Add this module to your Puppetfile:
mod 'covermymeds-redis', '1.0.3'
Learn more about managing modules with a PuppetfileDocumentation
puppet-redis
This module provides configuration management for Redis and Sentinel. This module aims to properly manage Redis setups that use Sentinel for the HA management.
This module is different than most available on the Forge in that it manages most of the Redis configuration using the redis-cli against the running instance. We took this approach because Redis by design persists state information to its own configuration file (http://redis.io/commands/config-rewrite). This makes management of /etc/redis.conf
and /etc/sentinel.conf
just about impossible for HA setups.
Provisos
- Requires Redis 2.8.0 or later.
- Assumes that Redis is available via a standard package install.
Usage
Install the latest available version of Redis with default configs (defaults provided in the template anyhow)
class { 'redis': }
Install Redis and configure as a slave. Manage some other configuration including persistence.
$config_hash = { 'dir' => '/pub/redis', 'maxmemory' => '1073741824' }
class { 'redis':
config => $config_hash,
manage_persistence => true,
slaveof => '192.168.33.10',
}
Install and configure Sentinel to manage 2 independent Redis Master/Slave setups. (Sentinel discovers the other slaves.)
$redis_clusters = { 'cluster1' => { 'master_ip' => '192.168.33.51',
'down_after' => '30000',
'failover_timeout' => '180000' },
'cluster2' => { 'master_ip' => '192.168.33.54',
'down_after' => '30000',
'failover_timeout' => '180000' },
}
class { 'sentinel':
redis_clusters => $redis_clusters,
}
Notes
The service definition is only dependent on the package so Redis may start with the configuration installed via your package. The initial config file overlay will notify the Redis server to restart so upon initial installation Redis may start and then restart with updated configs. In testing this has not presented any issues.
- Thu Aug 18 2016 Dan Sajner dsajner@covermymeds.com - 1.0.0
- BREAKING CHANGE: Introduces a semaphore file to enforce the one-time copy of initial redis and sentinel config files.
Dependencies
- puppetlabs/stdlib (4.x)
The MIT License (MIT) Copyright (c) 2015 CoverMyMeds Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.