Fix elasticsearch configuration in ipv6 environments

Closes-Bug: #1866727
Change-Id: I455ef6026b39110791cd38dac053205550af1ce2
This commit is contained in:
Jeffrey Zhang 2020-03-04 16:02:00 +08:00 committed by Radosław Piliszek
parent a7a61b9462
commit 3a8f533839
2 changed files with 8 additions and 3 deletions

View File

@ -1,13 +1,13 @@
{% set num_nodes = groups['elasticsearch'] | length %} {% 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 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 %} {% set recover_after_nodes = (num_nodes * 2 / 3) | round(0, 'floor') | int if num_nodes > 1 else 1 %}
node.name: "{{ api_interface_address }}" node.name: "{{ 'api' | kolla_address | put_address_in_context('url') }}"
network.host: "{{ 'api' | kolla_address }}" network.host: "{{ 'api' | kolla_address | put_address_in_context('url') }}"
cluster.name: "{{ elasticsearch_cluster_name }}" cluster.name: "{{ elasticsearch_cluster_name }}"
node.master: true node.master: true
node.data: 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 }} discovery.zen.minimum_master_nodes: {{ minimum_master_nodes }}
http.port: {{ elasticsearch_port }} http.port: {{ elasticsearch_port }}

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes elasticsearch deployment in IPv6 environments.
`LP#1866727 <https://launchpad.net/bugs/1866727>`__