Skip to content

Commit 8d0a9b2

Browse files
authored
Make ElasticSearch ports configurable. (#5294)
1 parent 9bc5e04 commit 8d0a9b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ansible/group_vars/all

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ db:
298298
backend: "{{ db_activation_backend | default('CouchDB') }}"
299299
elasticsearch:
300300
protocol: "{{ elastic_protocol | default('http') }}"
301-
port: 9200
301+
port: "{{ elastic_port | default(9200) }}"
302302
index_pattern: "{{ elastic_index_pattern | default('openwhisk-%s') }}"
303-
base_transport_port: 9300
303+
base_transport_port: "{{ elastic_transport_port_base | default(9300) }}"
304304
confdir: "{{ config_root_dir }}/elasticsearch"
305305
dir:
306306
become: "{{ elastic_dir_become | default(false) }}"
@@ -343,7 +343,7 @@ elasticsearch:
343343

344344
elasticsearch_connect_string: "{% set ret = [] %}\
345345
{% for host in groups['elasticsearch'] %}\
346-
{{ ret.append( hostvars[host].ansible_host + ':' + ((db.elasticsearch.port+loop.index-1)|string) ) }}\
346+
{{ ret.append( hostvars[host].ansible_host + ':' + ((db.elasticsearch.port|int+loop.index-1)|string) ) }}\
347347
{% endfor %}\
348348
{{ ret | join(',') }}"
349349
mongodb:

ansible/roles/elasticsearch/templates/elasticsearch.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ transport.tcp.port: {{ transport_port }}
1111
# Details: https://github.com/elastic/elasticsearch/pull/17282
1212
discovery.zen.ping.unicast.hosts:
1313
{% for es in groups['elasticsearch'] %}
14-
- {{ hostvars[es].ansible_host }}:{{ db.elasticsearch.base_transport_port + host_group.index(es)|int }}
14+
- {{ hostvars[es].ansible_host }}:{{ db.elasticsearch.base_transport_port|int + host_group.index(es)|int }}
1515
{% endfor %}
1616
discovery.zen.minimum_master_nodes: {{ (host_group|length / 2 + 1) | int}}
1717

0 commit comments

Comments
 (0)