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:
@@ -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 = ''
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user