core icon indicating copy to clipboard operation
core copied to clipboard

Load ES properties from YAML file

Open dsilvam opened this issue 8 years ago • 8 comments

  • Load ES properties from YAML localted at ES_PATH_CONF, and defaulting to WEB-INF/elasticsearch/config if ES_PATH_CONF is 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)

dsilvam avatar Mar 20 '18 16:03 dsilvam

PR Core: https://github.com/dotCMS/core/pull/13902

nollymar avatar Mar 20 '18 18:03 nollymar

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

nollymar avatar Mar 21 '18 14:03 nollymar

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

dsilvam avatar Mar 21 '18 21:03 dsilvam

Notes from conversation with @chrismccracken and @nollymar:

Changes for ESClient.setClusterNode :

  1. 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 if elasticsearch-ext.yml is 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.enabled comes with true from the override file, and this is not set, set same ip as transport.host)
    • es.http.port
    • transport.host
    • transport.tcp.port
  • if ClusterUtils.isESAutoWire()==false: from the values in the elasticsearch-ext.yml file
  1. Build the unicast host list and set it to es.discovery.zen.ping.unicast.hosts (look at the existing logic)
  2. Save the server object
  3. 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

  1. load the default yml properties (elasticsearch.yml)
  2. Apply override values form the map received from parameters
  3. Init node

dsilvam avatar Mar 22 '18 20:03 dsilvam

PRs with the implementation suggested above:

Core: https://github.com/dotCMS/core/pull/13991 EE: https://github.com/dotCMS/enterprise-2.x/pull/604

nollymar avatar Mar 27 '18 20:03 nollymar

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

DeanGonzalez avatar Apr 04 '18 14:04 DeanGonzalez

Passed QA. Successfully set up configuration to combine embedded ES server with an external ES server as master image

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

Tested on master branch / Mac OS 10.10 / Postgres 9.6.6 / Chrome v64.0.3282.167 / Tomcat 8 / Java 8.6

shaydotcms avatar Apr 12 '18 21:04 shaydotcms

@nollymar let's include notes and brief explanation to elasticsearch-ext.yml about how it can be used

dsilvam avatar Apr 17 '18 19:04 dsilvam