kolla-ansible/ansible/roles/elasticsearch/templates/elasticsearch.yml.j2
caoyuan adc55af3cb Add elasticsearch port
and ps to make the port configurable

Change-Id: I919767469087b9579e3d2f0965df835e7b71c327
2018-08-03 08:38:49 +00:00

23 lines
1.1 KiB
Django/Jinja

{% 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: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
cluster.name: "{{ elasticsearch_cluster_name }}"
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: [{% for host in groups['elasticsearch'] %}"{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}"{% if not loop.last %},{% endif %}{% endfor %}]
discovery.zen.minimum_master_nodes: {{ minimum_master_nodes }}
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"