Make ceilometer dbsync command timeout to be an optional parameter

The default dbsync command timeout value 3600 seconds may be too small
when there are large data in ceilometer database.
Make timeout to be optional to fix this problem.

Change-Id: Id4e703fab260f8e010ff089e4134e7aab8e21fd2
Closes-bug: #1389111
This commit is contained in:
lqslan 2014-11-05 11:16:17 +08:00
parent 67e3279071
commit 2d36ef461f
6 changed files with 13 additions and 2 deletions

View File

@ -12,6 +12,7 @@ h_algorithms to be configurable
* Remove old nosql check for running dbsync
* Bump Chef gem to 11.16
* Allow rabbit_hosts and rabbit_ha_queues to be configurable
* Allow dbsync_timeout to be configurable
## 10.0.0
* Upgrading to Juno

View File

@ -75,6 +75,7 @@ Attributes
* `openstack['telemetry']['api']['auth']['insecure']` - Set whether to verify HTTPS connections
* `openstack['telemetry']['service-credentials']['cafile']` - A PEM encoded Certificate Authority to use when verifying HTTPs connections (for service polling authentication)
* `openstack['telemetry']['service-credentials']['insecure']` - Set whether to verify HTTPS connections (for service polling authentication)
* `openstack['telemetry']['dbsync_timeout']` - Set dbsync command timeout value
The following attributes are defined in attributes/default.rb of the common cookbook, but are documented here due to their relevance:

View File

@ -68,6 +68,8 @@ default['openstack']['telemetry']['service-credentials']['insecure'] = false
default['openstack']['telemetry']['sample_source'] = 'openstack'
default['openstack']['telemetry']['dbsync_timeout'] = 3600
case node['openstack']['compute']['driver']
when 'libvirt.LibvirtDriver'
default['openstack']['telemetry']['hypervisor_inspector'] = 'libvirt'

View File

@ -26,6 +26,7 @@ conf_switch = "--config-file #{node["openstack"]["telemetry"]["conf"]}"
execute 'database migration' do
command "ceilometer-dbsync #{conf_switch}"
timeout node['openstack']['telemetry']['dbsync_timeout']
end
platform = node['openstack']['telemetry']['platform']

View File

@ -12,8 +12,11 @@ describe 'openstack-telemetry::collector' do
include_examples 'expect-runs-common-recipe'
it 'executes ceilometer dbsync' do
node.set['openstack']['telemetry']['dbsync_timeout'] = 36000
command = 'ceilometer-dbsync --config-file /etc/ceilometer/ceilometer.conf'
expect(chef_run).to run_execute command
expect(chef_run).to run_execute(command).with(
timeout: 36000
)
end
it 'installs the collector package' do

View File

@ -16,8 +16,11 @@ describe 'openstack-telemetry::collector' do
end
it 'executes ceilometer dbsync' do
node.set['openstack']['telemetry']['dbsync_timeout'] = 36000
command = 'ceilometer-dbsync --config-file /etc/ceilometer/ceilometer.conf'
expect(chef_run).to run_execute command
expect(chef_run).to run_execute(command).with(
timeout: 36000
)
end
it 'installs python-mysqldb' do