Set event,meter_dispatchers=database explicitly when used with MongoDB

The default value of event and meter_dispatchers were "database"
implicitly. However with Newton, there is no default value for
event_dispatchers. And empty meter_dispathers with Ocata. While Gnocchi
and Panko are preferred solutions, keep backward compatibility to
support an upgrade for existing deployments with MongoDB.

event_dispathers is not needed for Ocata since v2/events API has been
removed completely from Ceilometer.

Change-Id: I3a0f3fb029136d106afe0e77b704ee0c303ab27f
Closes-Bug: #1711932
This commit is contained in:
Nobuto Murata 2017-08-21 00:33:59 +07:00
parent 58b7465717
commit 486b6f9718
2 changed files with 67 additions and 0 deletions

View File

@ -13,6 +13,9 @@ event_pipeline_cfg_file = /etc/ceilometer/event_pipeline_alarm.yaml
{% if gnocchi_url -%}
meter_dispatchers = gnocchi
event_dispatchers = gnocchi
{% elif db_host or db_mongo_servers -%}
meter_dispatchers = database
event_dispatchers = database
{%- endif %}
[api]

View File

@ -0,0 +1,64 @@
# ocata
###############################################################################
# [ WARNING ]
# ceilometer configuration file maintained by Juju
# local changes may be overwritten.
###############################################################################
[DEFAULT]
debug = {{ debug }}
verbose = {{ verbose }}
use_syslog = {{ use_syslog }}
event_pipeline_cfg_file = /etc/ceilometer/event_pipeline_alarm.yaml
{% if gnocchi_url -%}
meter_dispatchers = gnocchi
event_dispatchers = gnocchi
{% elif db_host or db_mongo_servers -%}
meter_dispatchers = database
{%- endif %}
[api]
port = {{ port }}
workers = {{ api_workers }}
{% if service_host -%}
[service_credentials]
auth_url = {{ service_protocol }}://{{ service_host }}:{{ service_port }}
project_name = {{ admin_tenant_name }}
username = {{ admin_user }}
password = {{ admin_password }}
{% if api_version == "3" -%}
project_domain_name = {{ admin_domain_name }}
user_domain_name = {{ admin_domain_name }}
{% else -%}
project_domain_name = default
user_domain_name = default
{% endif -%}
auth_type = password
{% endif -%}
{% if db_host or db_mongo_servers -%}
[database]
{% if db_replset: -%}
connection = mongodb://{{ db_mongo_servers }}/{{ db_name }}?readPreference=primaryPreferred&replicaSet={{ db_replset }}
mongodb_replica_set = {{ db_replset }}
{% else -%}
connection = mongodb://{{ db_host }}:{{ db_port }}/{{ db_name }}
{% endif %}
metering_time_to_live = {{ metering_time_to_live }}
event_time_to_live = {{ event_time_to_live }}
{%- endif %}
[publisher]
telemetry_secret = {{ metering_secret }}
{% if gnocchi_url -%}
[dispatcher_gnocchi]
filter_service_activity = False
archive_policy = {{ archive_policy }}
url = {{ gnocchi_url }}
{%- endif %}
{% include "section-keystone-authtoken-mitaka" %}
{% include "section-rabbitmq-oslo" %}