diff --git a/ansible/roles/elasticsearch/tasks/upgrade.yml b/ansible/roles/elasticsearch/tasks/upgrade.yml index 2559d6c8b8..9bd077e7d0 100644 --- a/ansible/roles/elasticsearch/tasks/upgrade.yml +++ b/ansible/roles/elasticsearch/tasks/upgrade.yml @@ -1,6 +1,10 @@ --- +- name: Set fact for Elasticsearch URL + set_fact: + elasticsearch_url: "{{ internal_protocol }}://{{ kolla_internal_vip_address | put_address_in_context('url') }}:{{ elasticsearch_port }}" + # The official procedure for upgrade elasticsearch: -# https://www.elastic.co/guide/en/elasticsearch/reference/5.6/restart-upgrade.html +# https://www.elastic.co/guide/en/elasticsearch/reference/6.x/restart-upgrade.html - name: Disable shard allocation become: true vars: @@ -8,7 +12,7 @@ kolla_toolbox: module_name: uri module_args: - url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ elasticsearch_port }}/_cluster/settings" + url: "{{ elasticsearch_url }}/_cluster/settings" method: PUT status_code: 200 return_content: yes @@ -22,7 +26,7 @@ kolla_toolbox: module_name: uri module_args: - url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ elasticsearch_port }}/_flush/synced" + url: "{{ elasticsearch_url }}/_flush/synced" method: POST status_code: 200 return_content: yes diff --git a/ansible/roles/elasticsearch/templates/elasticsearch.json.j2 b/ansible/roles/elasticsearch/templates/elasticsearch.json.j2 index f34d2ea3bb..317ae56583 100644 --- a/ansible/roles/elasticsearch/templates/elasticsearch.json.j2 +++ b/ansible/roles/elasticsearch/templates/elasticsearch.json.j2 @@ -3,7 +3,7 @@ "config_files": [ { "source": "{{ container_config_directory }}/elasticsearch.yml", - "dest": "/usr/share/elasticsearch/config/elasticsearch.yml", + "dest": "/etc/elasticsearch/elasticsearch.yml", "owner": "elasticsearch", "perm": "0600" } diff --git a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 index a2486a2ad7..ec4ca41bd8 100644 --- a/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 +++ b/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2 @@ -14,9 +14,7 @@ http.port: {{ elasticsearch_port }} gateway.expected_nodes: {{ num_nodes }} gateway.recover_after_time: "5m" gateway.recover_after_nodes: {{ recover_after_nodes }} -path.conf: "/etc/elasticsearch" path.data: "/var/lib/elasticsearch/data" path.logs: "/var/log/kolla/elasticsearch" -path.scripts: "/etc/elasticsearch/scripts" indices.fielddata.cache.size: 40% action.auto_create_index: "true"