From ce809aea2327f8746db02b7699ac4ee1fe114bd9 Mon Sep 17 00:00:00 2001 From: Zhangfei Gao Date: Tue, 24 Apr 2018 14:08:28 +0800 Subject: [PATCH] osprofiler support redis Currently osprofiler only choose elasticsearch, which is only supported on x86. On other platform like aarch64 osprofiler can not be used since no elasticsearch package. Enable osprofiler by enable_osprofiler: "yes", which choose elasticsearch by default. Choose redis by enable_redis: "yes" & osprofiler_backend: "redis" On platform without elasticsearch support like aarch64 set enable_elasticsearch: "no" Change-Id: I68fe7a33e11d28684962fc5d0b3d326e90784d78 --- ansible/group_vars/all.yml | 14 ++++++++++++++ ansible/roles/cinder/templates/cinder.conf.j2 | 4 +--- ansible/roles/glance/templates/glance-api.conf.j2 | 4 +--- .../roles/glance/templates/glance-registry.conf.j2 | 4 +--- ansible/roles/heat/templates/heat.conf.j2 | 4 +--- ansible/roles/keystone/templates/keystone.conf.j2 | 4 +--- ansible/roles/magnum/templates/magnum.conf.j2 | 4 +--- ansible/roles/mistral/templates/mistral.conf.j2 | 4 +--- ansible/roles/neutron/templates/neutron.conf.j2 | 4 +--- ansible/roles/nova/templates/nova.conf.j2 | 4 +--- .../searchlight/templates/searchlight.conf.j2 | 4 +--- ansible/roles/senlin/templates/senlin.conf.j2 | 4 +--- .../roles/trove/templates/trove-conductor.conf.j2 | 4 +--- .../trove/templates/trove-taskmanager.conf.j2 | 4 +--- ansible/roles/trove/templates/trove.conf.j2 | 4 +--- ansible/roles/vitrage/templates/vitrage.conf.j2 | 4 +--- ansible/roles/zun/templates/zun.conf.j2 | 4 +--- etc/kolla/globals.yml | 6 ++++++ 18 files changed, 36 insertions(+), 48 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 9e426b8e33..63fc13a989 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -541,6 +541,20 @@ elasticsearch_address: "{{ kolla_internal_fqdn }}" enable_elasticsearch: "{{ 'yes' if enable_central_logging | bool or enable_freezer | bool or enable_osprofiler | bool or enable_skydive | bool or enable_monasca | bool else 'no' }}" enable_kibana: "{{ 'yes' if enable_central_logging | bool else 'no' }}" +#################### +# Redis options +#################### +redis_address: "{{ kolla_internal_fqdn }}" + +#################### +# Osprofiler options +#################### +# valid values: ["elasticsearch", "redis"] +osprofiler_backend: "elasticsearch" +elasticsearch_connection_string: "elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }}" +redis_connection_string: "redis://:{{ redis_master_password }}@{{ redis_address }}:{{ redis_port }}" +osprofiler_backend_connection_string: "{{ redis_connection_string if osprofiler_backend == 'redis' else elasticsearch_connection_string }}" + #################### # RabbitMQ options #################### diff --git a/ansible/roles/cinder/templates/cinder.conf.j2 b/ansible/roles/cinder/templates/cinder.conf.j2 index 7396c8fcc7..1a6672f372 100644 --- a/ansible/roles/cinder/templates/cinder.conf.j2 +++ b/ansible/roles/cinder/templates/cinder.conf.j2 @@ -203,9 +203,7 @@ helper_command=sudo cinder-rootwrap /etc/cinder/rootwrap.conf privsep-helper --c enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} {% if enable_barbican | bool %} diff --git a/ansible/roles/glance/templates/glance-api.conf.j2 b/ansible/roles/glance/templates/glance-api.conf.j2 index 85aee91a68..e0853fdadd 100644 --- a/ansible/roles/glance/templates/glance-api.conf.j2 +++ b/ansible/roles/glance/templates/glance-api.conf.j2 @@ -103,7 +103,5 @@ policy_file = {{ glance_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/glance/templates/glance-registry.conf.j2 b/ansible/roles/glance/templates/glance-registry.conf.j2 index 537fe28d9c..1780c318f7 100644 --- a/ansible/roles/glance/templates/glance-registry.conf.j2 +++ b/ansible/roles/glance/templates/glance-registry.conf.j2 @@ -50,7 +50,5 @@ policy_file = {{ glance_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/heat/templates/heat.conf.j2 b/ansible/roles/heat/templates/heat.conf.j2 index b3fd768a79..09a85eb763 100644 --- a/ansible/roles/heat/templates/heat.conf.j2 +++ b/ansible/roles/heat/templates/heat.conf.j2 @@ -103,7 +103,5 @@ enable_proxy_headers_parsing = True enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/keystone/templates/keystone.conf.j2 b/ansible/roles/keystone/templates/keystone.conf.j2 index c6a5a67d80..4ea8b85a56 100644 --- a/ansible/roles/keystone/templates/keystone.conf.j2 +++ b/ansible/roles/keystone/templates/keystone.conf.j2 @@ -52,9 +52,7 @@ driver = messagingv2 enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} {% if enable_grafana | bool %} diff --git a/ansible/roles/magnum/templates/magnum.conf.j2 b/ansible/roles/magnum/templates/magnum.conf.j2 index 8d9aec4b39..48726d5b0e 100644 --- a/ansible/roles/magnum/templates/magnum.conf.j2 +++ b/ansible/roles/magnum/templates/magnum.conf.j2 @@ -103,7 +103,5 @@ policy_file = {{ magnum_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/mistral/templates/mistral.conf.j2 b/ansible/roles/mistral/templates/mistral.conf.j2 index 1c63111f48..2f93b0c486 100644 --- a/ansible/roles/mistral/templates/mistral.conf.j2 +++ b/ansible/roles/mistral/templates/mistral.conf.j2 @@ -67,9 +67,7 @@ policy_file = {{ mistral_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} [coordination] diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index ea4003aea5..b87541dfcc 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -152,9 +152,7 @@ ipv6_ptr_zone_prefix_size = 116 enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} {% if enable_opendaylight_qos | bool %} diff --git a/ansible/roles/nova/templates/nova.conf.j2 b/ansible/roles/nova/templates/nova.conf.j2 index e3c4a76005..da6ff2f3c9 100644 --- a/ansible/roles/nova/templates/nova.conf.j2 +++ b/ansible/roles/nova/templates/nova.conf.j2 @@ -277,9 +277,7 @@ notify_on_state_change = vm_and_task_state enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} {% if enable_barbican | bool %} diff --git a/ansible/roles/searchlight/templates/searchlight.conf.j2 b/ansible/roles/searchlight/templates/searchlight.conf.j2 index a0bb7a6d53..b42f8fc66b 100644 --- a/ansible/roles/searchlight/templates/searchlight.conf.j2 +++ b/ansible/roles/searchlight/templates/searchlight.conf.j2 @@ -129,7 +129,5 @@ notifications_topics_exchanges = ironic_versioned_notifications,ironic {# enabled = true #} {# trace_sqlalchemy = true #} {# hmac_keys = {{ osprofiler_secret }} #} -{# {% if enable_elasticsearch | bool %} #} -{# connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} #} -{# {% endif %} #} +{# connection_string = {{ osprofiler_backend_connection_string }} #} {# {% endif %} #} diff --git a/ansible/roles/senlin/templates/senlin.conf.j2 b/ansible/roles/senlin/templates/senlin.conf.j2 index f2135be25f..1dd13e4ef4 100644 --- a/ansible/roles/senlin/templates/senlin.conf.j2 +++ b/ansible/roles/senlin/templates/senlin.conf.j2 @@ -62,7 +62,5 @@ policy_file = {{ senlin_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/trove/templates/trove-conductor.conf.j2 b/ansible/roles/trove/templates/trove-conductor.conf.j2 index e9c4bc61ce..aff9fca256 100644 --- a/ansible/roles/trove/templates/trove-conductor.conf.j2 +++ b/ansible/roles/trove/templates/trove-conductor.conf.j2 @@ -22,7 +22,5 @@ max_retries = -1 enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/trove/templates/trove-taskmanager.conf.j2 b/ansible/roles/trove/templates/trove-taskmanager.conf.j2 index 2740153901..9a3af2eb8e 100644 --- a/ansible/roles/trove/templates/trove-taskmanager.conf.j2 +++ b/ansible/roles/trove/templates/trove-taskmanager.conf.j2 @@ -48,7 +48,5 @@ driver = noop enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/trove/templates/trove.conf.j2 b/ansible/roles/trove/templates/trove.conf.j2 index b966ec9d8e..49aec97817 100644 --- a/ansible/roles/trove/templates/trove.conf.j2 +++ b/ansible/roles/trove/templates/trove.conf.j2 @@ -54,7 +54,5 @@ driver = noop enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/vitrage/templates/vitrage.conf.j2 b/ansible/roles/vitrage/templates/vitrage.conf.j2 index ff92dbfad4..7a4c5d5c3f 100644 --- a/ansible/roles/vitrage/templates/vitrage.conf.j2 +++ b/ansible/roles/vitrage/templates/vitrage.conf.j2 @@ -64,7 +64,5 @@ policy_file = {{ vitrage_policy_file }} enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} diff --git a/ansible/roles/zun/templates/zun.conf.j2 b/ansible/roles/zun/templates/zun.conf.j2 index 627b0e7e23..f931f2a3eb 100644 --- a/ansible/roles/zun/templates/zun.conf.j2 +++ b/ansible/roles/zun/templates/zun.conf.j2 @@ -94,9 +94,7 @@ endpoint_type = internalURL enabled = true trace_sqlalchemy = true hmac_keys = {{ osprofiler_secret }} -{% if enable_elasticsearch | bool %} -connection_string = elasticsearch://{{ elasticsearch_address }}:{{ elasticsearch_port }} -{% endif %} +connection_string = {{ osprofiler_backend_connection_string }} {% endif %} [oslo_concurrency] diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 75bc08372f..0b296d8e12 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -162,6 +162,7 @@ kolla_internal_vip_address: "10.10.10.254" #enable_congress: "no" #enable_designate: "no" #enable_destroy_images: "no" +#enable_elasticsearch: "{{ 'yes' if enable_central_logging | bool or enable_freezer | bool or enable_osprofiler | bool or enable_skydive | bool else 'no' }}" #enable_etcd: "no" #enable_fluentd: "yes" #enable_freezer: "no" @@ -306,6 +307,11 @@ kolla_internal_vip_address: "10.10.10.254" # in glance, so default value should be set to "no". glance_enable_rolling_upgrade: "no" +#################### +# Osprofiler options +#################### +# valid values: ["elasticsearch", "redis"] +#osprofiler_backend: "elasticsearch" ################## # Barbican options