core icon indicating copy to clipboard operation
core copied to clipboard

config does not work consistently for Elasticsearch properties

Open chrismccracken opened this issue 8 years ago • 10 comments

In the following example, only ES_DISCOVERY_HOSTS works correctly:

es.network.host=${ES_BIND_ADDR}
es.http.port=${ES_PORT}
es.discovery.zen.ping.unicast.hosts=${ES_DISCOVERY_HOSTS}

The env vars are being set correctly prior to JVM init (this example does not have ES_PORT, but it behaved the same way): image

chrismccracken avatar Mar 14 '18 21:03 chrismccracken

21:12:58.192  INFO  discovery.DiscoveryModule - using discovery type [zen]
21:12:59.004  INFO  node.Node - initialized
21:12:59.004  INFO  node.Node - starting ...
21:12:59.221  INFO  transport.TransportService - publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
21:13:02.284  INFO  service.MasterService - zen-disco-elected-as-master ([0] nodes joined), reason: new_master {d604a992-d36d-4194-b2eb-81a82a11b29a}{d4qKG9o7RHS_7heNYekL3w}{nFvZk9rSQxiRnXFwlF6LnQ}{127.0.0.1}{127.0.0.1:9300}
21:13:02.292  INFO  service.ClusterApplierService - new_master {d604a992-d36d-4194-b2eb-81a82a11b29a}{d4qKG9o7RHS_7heNYekL3w}{nFvZk9rSQxiRnXFwlF6LnQ}{127.0.0.1}{127.0.0.1:9300}, reason: apply cluster state (from master [master {d604a992-d36d-4194-b2eb-81a82a11b29a}{d4qKG9o7RHS_7heNYekL3w}{nFvZk9rSQxiRnXFwlF6LnQ}{127.0.0.1}{127.0.0.1:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
21:13:02.305  INFO  netty4.Netty4HttpServerTransport - publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
21:13:02.305  INFO  node.Node - started
21:13:02.322  INFO  gateway.GatewayService - recovered [0] indices into cluster_state

chrismccracken avatar Mar 14 '18 21:03 chrismccracken

I think the issue here is the formatting. Based on https://dotcms.com/docs/latest/changing-dotcms-configuration-properties#References I believe the proper formatting should be:

es.network.host={sys:ES_BIND_ADDR} es.http.port={sys:ES_PORT} es.discovery.zen.ping.unicast.hosts={sys:ES_DISCOVERY_HOSTS}

This format seemed to work correctly with a test.jsp page locally when setting those values as "-D" in my startup script

brentgriffin avatar Mar 15 '18 15:03 brentgriffin

the "env:" variant also seems to work when those variables are set in the environment

brentgriffin avatar Mar 15 '18 15:03 brentgriffin

Can this be closed?

wezell avatar Mar 15 '18 15:03 wezell

great!

jdotcms avatar Mar 15 '18 15:03 jdotcms

Actually, the env: variant does not work either. But neither does that actual string "9303". The issue appears to be that the config params are ignored outright, not an issue with variable interpolation.

chrismccracken avatar Mar 15 '18 22:03 chrismccracken

The following properties in dotserver/tomcat-8.5.24/webapps/ROOT/WEB-INF/classes/dotcms-config-cluster.properties seem to be ignored in the Elasticsearch init under non-autowire mode:

es.network.host=10.0.1.11
es.transport.host=10.0.1.11
es.transport.tcp.port=9303

Autowire is disabled as follows:

AUTOWIRE_CLUSTER_ES=false
AUTOWIRE_MANAGE_ES_REPLICAS=false

chrismccracken avatar Mar 15 '18 22:03 chrismccracken

dotcms.log showing transport.TransportService: publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300} with the port and ip wrong:

[15/03/18 15:47:26:832 PDT]  INFO util.ESClient: ***PATH HOME: /Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/webapps/ROOT/WEB-INF/elastic_search
[15/03/18 15:47:26:832 PDT]  INFO util.ESClient: ***PATH DATA: /Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/webapps/ROOT/dotsecure/esdata
[15/03/18 15:47:26:832 PDT]  INFO util.ESClient: ***PATH REPO: /Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/webapps/ROOT/dotsecure/essnapshot/snapshots
[15/03/18 15:47:27:026 PDT]  INFO node.Node: initializing ...
[15/03/18 15:47:27:163 PDT]  INFO env.NodeEnvironment: using [1] data paths, mounts [[/ (/dev/disk1s1)]], net usable_space [571.4gb], net total_space [931.5gb], types [apfs]
[15/03/18 15:47:27:167 PDT]  INFO env.NodeEnvironment: heap size [1gb], compressed ordinary object pointers [true]
[15/03/18 15:47:27:177 PDT]  INFO node.Node: node name [68332553-0641-487b-8410-a631ccfe5758], node ID [Y3elFKdET7yg0r1DggE4Hg]
[15/03/18 15:47:27:177 PDT]  INFO node.Node: version[6.1.3], pid[72835], build[af51318/2018-01-26T18:22:55.523Z], OS[Mac OS X/10.13.3/x86_64], JVM[Oracle Corporation/Java HotSpot(TM) 64-Bit Server VM/1.8.0_131/25.131-b11]
[15/03/18 15:47:27:177 PDT]  INFO node.Node: JVM arguments [-Djava.util.logging.config.file=/Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/conf/logging.properties, -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager, -Djava.awt.headless=true, -Xverify:none, -Dfile.encoding=UTF8, -XX:+DisableExplicitGC, -XX:MaxMetaspaceSize=512m, -Xmx1G, -XX:+UseG1GC, -javaagent:/Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/webapps/ROOT/WEB-INF/lib/byte-buddy-agent-1.6.12.jar, -Ddotserver=5.0-nightly-2018-03-12_22-06, -Djdk.tls.ephemeralDHKeySize=2048, -Djava.protocol.handler.pkgs=org.apache.catalina.webresources, -Dignore.endorsed.dirs=, -Dcatalina.base=/Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24, -Dcatalina.home=/Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24, -Djava.io.tmpdir=/Users/chris/dotcms/dist/5.0-nightly-2018-03-12_22-06/dotserver/tomcat-8.5.24/temp]
[15/03/18 15:47:27:718 PDT]  INFO plugins.PluginsService: loaded module [aggs-matrix-stats]
[15/03/18 15:47:27:718 PDT]  INFO plugins.PluginsService: loaded module [analysis-common]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [ingest-common]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [lang-expression]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [lang-mustache]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [lang-painless]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [mapper-extras]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [parent-join]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [percolator]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [reindex]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [repository-url]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [transport-netty4]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded module [tribe]
[15/03/18 15:47:27:719 PDT]  INFO plugins.PluginsService: loaded plugin [script-expert-relationships-sort]
[15/03/18 15:47:29:318 PDT]  INFO business.HazelcastUtil: Initialized Hazelcast member HazelcastInstance{name='_hzInstance_1_dev', node=[192.168.254.230]:5701}
[15/03/18 15:47:29:453 PDT]  INFO transport.HazelcastCacheTransportEmbedded: Sending Ping to Cluster Thu Mar 15 15:47:29 PDT 2018
[15/03/18 15:47:29:465 PDT]  INFO transport.HazelcastCacheTransportEmbedded: Received Message Ping Thu Mar 15 15:47:29 PDT 2018
[15/03/18 15:47:29:465 PDT]  INFO transport.HazelcastCacheTransportEmbedded: ACK Received Thu Mar 15 15:47:29 PDT 2018
[15/03/18 15:47:29:481 PDT]  INFO discovery.DiscoveryModule: using discovery type [zen]
[15/03/18 15:47:30:142 PDT]  INFO node.Node: initialized
[15/03/18 15:47:30:143 PDT]  INFO node.Node: starting ...
[15/03/18 15:47:30:348 PDT]  INFO transport.TransportService: publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300}
[15/03/18 15:47:33:404 PDT]  INFO service.MasterService: zen-disco-elected-as-master ([0] nodes joined), reason: new_master {68332553-0641-487b-8410-a631ccfe5758}{Y3elFKdET7yg0r1DggE4Hg}{huXk1YNIRyC1q-l1bas8lQ}{127.0.0.1}{127.0.0.1:9300}
[15/03/18 15:47:33:410 PDT]  INFO service.ClusterApplierService: new_master {68332553-0641-487b-8410-a631ccfe5758}{Y3elFKdET7yg0r1DggE4Hg}{huXk1YNIRyC1q-l1bas8lQ}{127.0.0.1}{127.0.0.1:9300}, reason: apply cluster state (from master [master {68332553-0641-487b-8410-a631ccfe5758}{Y3elFKdET7yg0r1DggE4Hg}{huXk1YNIRyC1q-l1bas8lQ}{127.0.0.1}{127.0.0.1:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[15/03/18 15:47:33:421 PDT]  INFO netty4.Netty4HttpServerTransport: publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200}
[15/03/18 15:47:33:422 PDT]  INFO node.Node: started
[15/03/18 15:47:33:640 PDT]  INFO gateway.GatewayService: recovered [2] indices into cluster_state
[15/03/18 15:47:33:970 PDT]  INFO allocation.AllocationService: Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[working_20180315153525][0]] ...]).
[15/03/18 15:47:3

chrismccracken avatar Mar 15 '18 22:03 chrismccracken

Fixed in https://github.com/dotCMS/core/issues/13900

nollymar avatar Mar 28 '18 16:03 nollymar

#13900 passed QA

shaydotcms avatar Apr 12 '18 21:04 shaydotcms