Allow oslo rabbit heartbeat configuration

In order to allow components to better handle and respond to mq failures,
oslo has some heartbeat options that are useful.

Change-Id: I75b2b5e140095bdc828df6af13159170aa08839c
Partial-Bug: #1462438
This commit is contained in:
Mark Vanderwiel 2015-06-05 11:37:04 -05:00
parent 134ab374ed
commit fafc3c83ac
2 changed files with 21 additions and 0 deletions

View File

@ -59,6 +59,11 @@ default['openstack']['mq']['rabbitmq']['use_ssl'] = false
default['openstack']['mq']['rabbitmq']['kombu_ssl_version'] = nil
# global switch for handling rabbit ha
default['openstack']['mq']['rabbitmq']['ha'] = false
# global switch for number of seconds after which the Rabbit broker is considered down if heartbeat's keep-alive fails (0 disable the heartbeat)
default['openstack']['mq']['rabbitmq']['heartbeat_timeout_threshold'] = 0
# global switch for how often times during the heartbeat_timeout_threshold we check the heartbeat
default['openstack']['mq']['rabbitmq']['heartbeat_rate'] = 2
# defined in oslo/messaging/_drivers/impl_qpid.py
default['openstack']['mq']['qpid']['topology_version'] = 1
qpid_defaults = {
@ -87,6 +92,8 @@ rabbit_defaults = {
port: node['openstack']['endpoints']['mq']['port'],
host: node['openstack']['endpoints']['mq']['host'],
ha: node['openstack']['mq']['rabbitmq']['ha'],
heartbeat_timeout_threshold: node['openstack']['mq']['rabbitmq']['heartbeat_timeout_threshold'],
heartbeat_rate: node['openstack']['mq']['rabbitmq']['heartbeat_rate'],
use_ssl: node['openstack']['mq']['rabbitmq']['use_ssl'],
kombu_ssl_version: node['openstack']['mq']['rabbitmq']['kombu_ssl_version']
}

View File

@ -56,6 +56,20 @@ describe 'openstack-common::default' do
end
end
it 'enables rabbit heartbeat_timeout_threshold for all services' do
node.set['openstack']['mq']['rabbitmq']['heartbeat_timeout_threshold'] = 123
mq_services.each do |svc|
expect(chef_run.node['openstack']['mq'][svc]['rabbit']['heartbeat_timeout_threshold']).to eq(123)
end
end
it 'enables rabbit heartbeat_rate for all services' do
node.set['openstack']['mq']['rabbitmq']['heartbeat_rate'] = 123
mq_services.each do |svc|
expect(chef_run.node['openstack']['mq'][svc]['rabbit']['heartbeat_rate']).to eq(123)
end
end
it 'has correct host for endpoints' do
%w(identity-api identity-internal identity-admin compute-api compute-ec2-api compute-ec2-admin
compute-xvpvnc compute-novnc compute-vnc compute-metadata-api network-api network-linuxbridge