From 3a8f53383928b12935ea7265ff5e0696d7d01ae4 Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Wed, 4 Mar 2020 16:02:00 +0800 Subject: [PATCH] Fix elasticsearch configuration in ipv6 environments Closes-Bug: #1866727 Change-Id: I455ef6026b39110791cd38dac053205550af1ce2 --- ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 | 6 +++--- releasenotes/notes/bug-1866727-731e51e9bdef7f6b.yaml | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/bug-1866727-731e51e9bdef7f6b.yaml diff --git a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 index 618fd03089..a2486a2ad7 100644 --- a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 +++ b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 @@ -1,13 +1,13 @@ {% set num_nodes = groups['elasticsearch'] | length %} {% set minimum_master_nodes = (num_nodes / 2 + 1) | round(0, 'floor') | int if num_nodes > 2 else 1 %} {% set recover_after_nodes = (num_nodes * 2 / 3) | round(0, 'floor') | int if num_nodes > 1 else 1 %} -node.name: "{{ api_interface_address }}" -network.host: "{{ 'api' | kolla_address }}" +node.name: "{{ 'api' | kolla_address | put_address_in_context('url') }}" +network.host: "{{ 'api' | kolla_address | put_address_in_context('url') }}" cluster.name: "{{ elasticsearch_cluster_name }}" node.master: true node.data: true -discovery.zen.ping.unicast.hosts: [{% for host in groups['elasticsearch'] %}"{{ 'api' | kolla_address(host) }}"{% if not loop.last %},{% endif %}{% endfor %}] +discovery.zen.ping.unicast.hosts: [{% for host in groups['elasticsearch'] %}"{{ 'api' | kolla_address(host) | put_address_in_context('url') }}"{% if not loop.last %},{% endif %}{% endfor %}] discovery.zen.minimum_master_nodes: {{ minimum_master_nodes }} http.port: {{ elasticsearch_port }} diff --git a/releasenotes/notes/bug-1866727-731e51e9bdef7f6b.yaml b/releasenotes/notes/bug-1866727-731e51e9bdef7f6b.yaml new file mode 100644 index 0000000000..a2d3a4ade9 --- /dev/null +++ b/releasenotes/notes/bug-1866727-731e51e9bdef7f6b.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes elasticsearch deployment in IPv6 environments. + `LP#1866727 `__