Add support for redis sentinel and slaves

If the correct configuration settings are set in the answer file
redis and redis-sentinel will be installed and configured on slave
and sentinel hosts. The sentinels will monitor the master and
keep track of the slaves. If the master dies, then the sentinels
will consensually establish a new master.

Change-Id: I7acc5e4f7bb99692bfe1c8694e8ddb0c472160f4
This commit is contained in:
Chris Dent
2015-01-05 23:38:16 +00:00
parent 38bcdb2491
commit 3fd2f89875
6 changed files with 215 additions and 25 deletions

View File

@@ -3,9 +3,16 @@ $config_mongodb_host = hiera('CONFIG_MONGODB_HOST')
$config_ceilometer_coordination_backend = hiera('CONFIG_CEILOMETER_COORDINATION_BACKEND')
if $config_ceilometer_coordination_backend == 'redis' {
$redis_host = hiera('CONFIG_REDIS_HOST')
$redis_host = hiera('CONFIG_REDIS_MASTER_HOST')
$redis_port = hiera('CONFIG_REDIS_PORT')
$coordination_url = "redis://${redis_host}:${redis_port}"
$sentinel_host = hiera('CONFIG_REDIS_SENTINEL_CONTACT_HOST')
if $sentinel_host != '' {
$master_name = hiera('CONFIG_REDIS_MASTER_NAME')
$sentinel_port = hiera('CONFIG_REDIS_SENTINEL_PORT')
$coordination_url = "redis://${sentinel_host}:${sentinel_port}?sentinel=${master_name}"
} else {
$coordination_url = "redis://${redis_host}:${redis_port}"
}
} else {
$coordination_url = ''
}