Add support for RabbitMQ connection heartbeat
Kilo oslo.messaging added heartbeating support for RabbitMQ connections. This patch adds support for this in Puppet modules by managing the oslo_messaging_rabbit/heartbeat_timeout_threshold and oslo_messaging_rabbit/heartbeat_rate settings. Closes-bug: 1467667 Change-Id: I985d081c86975c5b216f6346cbd9a368dd0d33d3
This commit is contained in:
parent
4d18c07eed
commit
f9cd34f8a7
|
@ -41,6 +41,22 @@
|
||||||
# password to connect to the rabbit_server. Optional. Defaults to empty.
|
# password to connect to the rabbit_server. Optional. Defaults to empty.
|
||||||
# [*rabbit_virtual_host*]
|
# [*rabbit_virtual_host*]
|
||||||
# virtualhost to use. Optional. Defaults to '/'
|
# virtualhost to use. Optional. Defaults to '/'
|
||||||
|
#
|
||||||
|
# [*rabbit_heartbeat_timeout_threshold*]
|
||||||
|
# (optional) Number of seconds after which the RabbitMQ broker is considered
|
||||||
|
# down if the heartbeat keepalive fails. Any value >0 enables heartbeats.
|
||||||
|
# Heartbeating helps to ensure the TCP connection to RabbitMQ isn't silently
|
||||||
|
# closed, resulting in missed or lost messages from the queue.
|
||||||
|
# (Requires kombu >= 3.0.7 and amqp >= 1.4.0)
|
||||||
|
# Defaults to 0
|
||||||
|
#
|
||||||
|
# [*rabbit_heartbeat_rate*]
|
||||||
|
# (optional) How often during the rabbit_heartbeat_timeout_threshold period to
|
||||||
|
# check the heartbeat on RabbitMQ connection. (i.e. rabbit_heartbeat_rate=2
|
||||||
|
# when rabbit_heartbeat_timeout_threshold=60, the heartbeat will be checked
|
||||||
|
# every 30 seconds.
|
||||||
|
# Defaults to 2
|
||||||
|
#
|
||||||
# [*rabbit_use_ssl*]
|
# [*rabbit_use_ssl*]
|
||||||
# (optional) Connect over SSL for RabbitMQ
|
# (optional) Connect over SSL for RabbitMQ
|
||||||
# Defaults to false
|
# Defaults to false
|
||||||
|
@ -90,6 +106,8 @@ class ceilometer(
|
||||||
$rabbit_userid = 'guest',
|
$rabbit_userid = 'guest',
|
||||||
$rabbit_password = '',
|
$rabbit_password = '',
|
||||||
$rabbit_virtual_host = '/',
|
$rabbit_virtual_host = '/',
|
||||||
|
$rabbit_heartbeat_timeout_threshold = 0,
|
||||||
|
$rabbit_heartbeat_rate = 2,
|
||||||
$rabbit_use_ssl = false,
|
$rabbit_use_ssl = false,
|
||||||
$kombu_ssl_ca_certs = undef,
|
$kombu_ssl_ca_certs = undef,
|
||||||
$kombu_ssl_certfile = undef,
|
$kombu_ssl_certfile = undef,
|
||||||
|
@ -107,7 +125,7 @@ class ceilometer(
|
||||||
$qpid_reconnect_limit = 0,
|
$qpid_reconnect_limit = 0,
|
||||||
$qpid_reconnect_interval_min = 0,
|
$qpid_reconnect_interval_min = 0,
|
||||||
$qpid_reconnect_interval_max = 0,
|
$qpid_reconnect_interval_max = 0,
|
||||||
$qpid_reconnect_interval = 0
|
$qpid_reconnect_interval = 0,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
validate_string($metering_secret)
|
validate_string($metering_secret)
|
||||||
|
@ -191,6 +209,8 @@ class ceilometer(
|
||||||
'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true;
|
'oslo_messaging_rabbit/rabbit_password': value => $rabbit_password, secret => true;
|
||||||
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
|
'oslo_messaging_rabbit/rabbit_virtual_host': value => $rabbit_virtual_host;
|
||||||
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
|
'oslo_messaging_rabbit/rabbit_use_ssl': value => $rabbit_use_ssl;
|
||||||
|
'oslo_messaging_rabbit/heartbeat_timeout_threshold': value => $rabbit_heartbeat_timeout_threshold;
|
||||||
|
'oslo_messaging_rabbit/heartbeat_rate': value => $rabbit_heartbeat_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $rabbit_use_ssl {
|
if $rabbit_use_ssl {
|
||||||
|
|
|
@ -39,6 +39,7 @@ describe 'ceilometer' do
|
||||||
it_configures 'a ceilometer base installation'
|
it_configures 'a ceilometer base installation'
|
||||||
it_configures 'rabbit with SSL support'
|
it_configures 'rabbit with SSL support'
|
||||||
it_configures 'rabbit without HA support (with backward compatibility)'
|
it_configures 'rabbit without HA support (with backward compatibility)'
|
||||||
|
it_configures 'rabbit with connection heartbeats'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with rabbit_hosts parameter' do
|
context 'with rabbit_hosts parameter' do
|
||||||
|
@ -178,6 +179,8 @@ describe 'ceilometer' do
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) }
|
||||||
|
@ -194,6 +197,8 @@ describe 'ceilometer' do
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
||||||
|
@ -210,6 +215,8 @@ describe 'ceilometer' do
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] )
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ).with_secret(true)
|
||||||
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] )
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('0')
|
||||||
|
is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_rate').with_value('2')
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') }
|
||||||
|
@ -219,6 +226,18 @@ describe 'ceilometer' do
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
shared_examples_for 'rabbit with connection heartbeats' do
|
||||||
|
context "with heartbeat configuration" do
|
||||||
|
before { params.merge!(
|
||||||
|
:rabbit_heartbeat_timeout_threshold => '60',
|
||||||
|
:rabbit_heartbeat_rate => '10'
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60') }
|
||||||
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10') }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
shared_examples_for 'rabbit with SSL support' do
|
shared_examples_for 'rabbit with SSL support' do
|
||||||
context "with default parameters" do
|
context "with default parameters" do
|
||||||
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') }
|
it { is_expected.to contain_ceilometer_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') }
|
||||||
|
|
Loading…
Reference in New Issue