Skip to content

Commit

Permalink
Make ElasticSearch ports configurable.
Browse files Browse the repository at this point in the history
  • Loading branch information
style95 committed Jul 25, 2022
1 parent 8c140e0 commit aa27f7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ db:
backend: "{{ db_activation_backend | default('CouchDB') }}"
elasticsearch:
protocol: "{{ elastic_protocol | default('http') }}"
port: 9200
port: "{{ elastic_port | default(9200) }}"
index_pattern: "{{ elastic_index_pattern | default('openwhisk-%s') }}"
base_transport_port: 9300
base_transport_port: "{{ elastic_transport_port_base | default(9300) }}"
confdir: "{{ config_root_dir }}/elasticsearch"
dir:
become: "{{ elastic_dir_become | default(false) }}"
Expand Down Expand Up @@ -343,7 +343,7 @@ elasticsearch:

elasticsearch_connect_string: "{% set ret = [] %}\
{% for host in groups['elasticsearch'] %}\
{{ ret.append( hostvars[host].ansible_host + ':' + ((db.elasticsearch.port+loop.index-1)|string) ) }}\
{{ ret.append( hostvars[host].ansible_host + ':' + ((db.elasticsearch.port|int+loop.index-1)|string) ) }}\
{% endfor %}\
{{ ret | join(',') }}"
mongodb:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/elasticsearch/templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ transport.tcp.port: {{ transport_port }}
# Details: https://github.com/elastic/elasticsearch/pull/17282
discovery.zen.ping.unicast.hosts:
{% for es in groups['elasticsearch'] %}
- {{ hostvars[es].ansible_host }}:{{ db.elasticsearch.base_transport_port + host_group.index(es)|int }}
- {{ hostvars[es].ansible_host }}:{{ db.elasticsearch.base_transport_port|int + host_group.index(es)|int }}
{% endfor %}
discovery.zen.minimum_master_nodes: {{ (host_group|length / 2 + 1) | int}}

Expand Down

0 comments on commit aa27f7e

Please sign in to comment.