Load ES properties from YAML file
- Load ES properties from YAML localted at
ES_PATH_CONF, and defaulting toWEB-INF/elasticsearch/configifES_PATH_CONFis not set. Ship with a yaml file and read it on startup. - Let autowire override settings (if ESAUTOWIREENABLED) (currently done via System.setProps, which needs to change)
PR Core: https://github.com/dotCMS/core/pull/13902
elastic_search folder has been renamed to elasticsearch and Jenkins tests configuration has been modified accordingly.
PR's Core: https://github.com/dotCMS/core/pull/13919 , https://github.com/dotCMS/core/pull/13925
These docs need to be updated:
- https://dotcms.com/docs/latest/configuring-an-external-elasticsearch-server#ExternalOnly9 (remove the es.path.work, not used anymore)
- https://dotcms.com/docs/latest/integration-tests (some properties live now in the elasticsearch.yml file)
- https://dotcms.com/docs/latest/manual-cluster-configuration
Notes from conversation with @chrismccracken and @nollymar:
Changes for ESClient.setClusterNode :
- would fill a map of key-value properties which will be used to override the default values. These will be coming from:
- if
ClusterUtils.isESAutoWire()==true: from the autowire process but ifelasticsearch-ext.ymlis present, override autowire values with the values in this file. The properties whose values are determined by autowire should be:- es.http.host (if
http.enabledcomes withtruefrom the override file, and this is not set, set same ip as transport.host) - es.http.port
- transport.host
- transport.tcp.port
- es.http.host (if
- if
ClusterUtils.isESAutoWire()==false: from the values in theelasticsearch-ext.ymlfile
- Build the unicast host list and set it to
es.discovery.zen.ping.unicast.hosts(look at the existing logic) - Save the server object
- Send map to
initNode()method
Additional considerations for ESClient.setClusterNode:
- multicast enable - remove it
- timeout setting - remove it
- es.discovery.zen.ping.unicast.hosts: only touched by autowire, even if present in override file
elasticsearch-ext.yml
name convention for override file: elasticsearch-ext.yml
Changes for ESClient.init
- load the default yml properties (
elasticsearch.yml) - Apply override values form the map received from parameters
- Init node
PRs with the implementation suggested above:
Core: https://github.com/dotCMS/core/pull/13991 EE: https://github.com/dotCMS/enterprise-2.x/pull/604
Updated these three docs but waiting for a few last changes that will affect doc: https://authoring.dotcms.com/docs/latest/configuring-an-external-elasticsearch-server https://authoring.dotcms.com/docs/latest/manual-cluster-configuration https://authoring.dotcms.com/docs/latest/integration-tests
Passed QA.
Successfully set up configuration to combine embedded ES server with an external ES server as master

Successfully set up configuration to combine embedded and external ES servers, with both servers as master nodes with data

Tested on master branch / Mac OS 10.10 / Postgres 9.6.6 / Chrome v64.0.3282.167 / Tomcat 8 / Java 8.6
@nollymar let's include notes and brief explanation to elasticsearch-ext.yml about how it can be used