core icon indicating copy to clipboard operation
core copied to clipboard

Transport port and http port ES configuration settings are not honored

Open vianneychacon opened this issue 8 years ago • 4 comments

http.port and transport.tcp.port parameters are not honored by dotCMS using auto-wire and manual configuration.

Expected Behavior

http.port and transport.tcp.port should allow customization on both, auto-wire and manual configuration.

Current Behavior

Using auto-wire

The configuration

# Overwriting the elasticsearch.yml
cluster.name: myCluster
path.data: esdata
path.repo: essnapshot/snapshots
path.logs: tomcat8/logs
http.port: 9210
http.host: localhost
http.enabled: true
http.cors.enabled: false
transport.tcp.port: 9310

Settings are loaded into ES:

[13/09/18 10:26:01:020 UTC]  INFO transport.TransportService: publish_address {127.0.0.1:9310}, bound_addresses {127.0.0.1:9310}
[13/09/18 10:26:02:872 UTC]  INFO reindex.ReindexThread: Reindex Thread started with a sleep of 500
[13/09/18 10:26:04:064 UTC]  INFO service.MasterService: zen-disco-elected-as-master ([0] nodes joined), reason: new_master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{9X00lu1dTpG9qppull-Wmg}{localhost}
{127.0.0.1:9310}
[13/09/18 10:26:04:069 UTC]  INFO service.ClusterApplierService: new_master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{9X00lu1dTpG9qppull-Wmg}{localhost}{127.0.0.1:9310}, reason: apply cluster state (f
rom master [master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{9X00lu1dTpG9qppull-Wmg}{localhost}{127.0.0.1:9310} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[13/09/18 10:26:04:081 UTC]  INFO netty4.Netty4HttpServerTransport: publish_address {127.0.0.1:9210}, bound_addresses {127.0.0.1:9210}
[13/09/18 10:26:04:081 UTC]  INFO node.Node: started
[13/09/18 10:26:04:089 UTC]  INFO gateway.GatewayService: recovered [0] indices into cluster_state
[13/09/18 10:26:09:084 UTC]  INFO caffine.CaffineCache: ***      Building Cache : logmappercache, size:10,Concurrency:32
[13/09/18 10:26:09:087 UTC]  INFO business.ESIndexAPI: createIndex : Trying to create index: working_20180913102558 with shards: 0
[13/09/18 10:26:09:154 UTC]  INFO metadata.MetaDataCreateIndexService: [working_20180913102558] creating index, cause [api], templates [], shards [1]/[0], mappings []
[13/09/18 10:26:09:296 UTC]  INFO allocation.AllocationService: Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[working_20180913102558][0]] ...]).
[13/09/18 10:26:09:303 UTC]  INFO business.ESIndexAPI: createIndex : Index created: working_20180913102558 with shards: 1
[13/09/18 10:26:09:361 UTC]  INFO metadata.MetaDataMappingService: [working_20180913102558/g_cDMf8-TP-Z4dQdoJZnQg] create_mapping [content]
[13/09/18 10:26:09:369 UTC]  INFO business.ESIndexAPI: createIndex : Trying to create index: live_20180913102558 with shards: 0
[13/09/18 10:26:09:375 UTC]  INFO metadata.MetaDataCreateIndexService: [live_20180913102558] creating index, cause [api], templates [], shards [1]/[0], mappings []
[13/09/18 10:26:09:391 UTC]  INFO allocation.AllocationService: Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[live_20180913102558][0]] ...]).
[13/09/18 10:26:09:395 UTC]  INFO business.ESIndexAPI: createIndex : Index created: live_20180913102558 with shards: 1
[13/09/18 10:26:09:402 UTC]  INFO metadata.MetaDataMappingService: [live_20180913102558/o5cd4NMSTZKTJfKR48h-og] create_mapping [content]
[13/09/18 10:26:09:438 UTC]  INFO reindex.ReindexThread: ContentIndexationThread ordered to start processing

At some point it re-wires and settings are back to defaults:

[13/09/18 10:27:59:993 UTC]  INFO util.ESClient: discovery.zen.ping.unicast.hosts: 10.0.1.116:9300
[13/09/18 10:27:59:993 UTC]  INFO node.Node: stopping ...
[13/09/18 10:28:00:163 UTC]  INFO node.Node: stopped
[13/09/18 10:28:00:163 UTC]  INFO node.Node: closing ...
[13/09/18 10:28:00:172 UTC]  INFO node.Node: closed
[13/09/18 10:28:00:172 UTC]  INFO util.ESClient: ***PATH HOME: /opt/dotcms/wwwroot/dotCMS-5.0.1-4/dotserver/tomcat-8.5.32/webapps/ROOT/WEB-INF/elasticsearch
[13/09/18 10:28:00:176 UTC]  INFO node.Node: initializing ...
[13/09/18 10:28:00:187 UTC]  INFO env.NodeEnvironment: using [1] data paths, mounts [[/opt/dotcms (/dev/nvme1n1)]], net usable_space [40.7gb], net total_space [49.9gb], types [xfs]
[13/09/18 10:28:00:187 UTC]  INFO env.NodeEnvironment: heap size [2gb], compressed ordinary object pointers [true]
[13/09/18 10:28:00:190 UTC]  INFO node.Node: node name [e0daf741-07a8-42e8-a802-111496aafd20], node ID [qZH-tO8dTtmdkfVfCMuU5Q]
[13/09/18 10:28:00:190 UTC]  INFO node.Node: version[6.1.3], pid[9064], build[af51318/2018-01-26T18:22:55.523Z], OS[Linux/4.14.62-65.117.amzn1.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_181/25.181-b13]
[13/09/18 10:28:00:804 UTC]  INFO discovery.DiscoveryModule: using discovery type [zen]
[13/09/18 10:28:00:863 UTC]  INFO node.Node: initialized
[13/09/18 10:28:00:863 UTC]  INFO node.Node: starting ...
[13/09/18 10:28:01:038 UTC]  INFO transport.TransportService: publish_address {10.0.1.116:9300}, bound_addresses {10.0.1.116:9300}
[13/09/18 10:28:04:053 UTC]  INFO service.MasterService: zen-disco-elected-as-master ([0] nodes joined), reason: new_master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{CNuTREncR_e_rSUWLOnWbg}{10.0.1.116}{10.0.1.116:9300}
[13/09/18 10:28:04:053 UTC]  INFO service.ClusterApplierService: new_master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{CNuTREncR_e_rSUWLOnWbg}{10.0.1.116}{10.0.1.116:9300}, reason: apply cluster state (from master [master {e0daf741-07a8-42e8-a802-111496aafd20}{qZH-tO8dTtmdkfVfCMuU5Q}{CNuTREncR_e_rSUWLOnWbg}{10.0.1.116}{10.0.1.116:9300} committed version [1] source [zen-disco-elected-as-master ([0] nodes joined)]])
[13/09/18 10:28:04:066 UTC]  INFO netty4.Netty4HttpServerTransport: publish_address {127.0.0.1:9210}, bound_addresses {127.0.0.1:9210}
[13/09/18 10:28:04:066 UTC]  INFO node.Node: started
[13/09/18 10:28:04:114 UTC]  INFO gateway.GatewayService: recovered [2] indices into cluster_state
[13/09/18 10:28:04:115 UTC]  INFO metadata.MetaDataUpdateSettingsService: updating number_of_replicas to [0] for indices [live_20180913102558, working_20180913102558]
[13/09/18 10:28:04:282 UTC]  INFO allocation.AllocationService: Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[live_20180913102558][0]] ...]).

Using manual configuration

The configuration

cluster.name: myCluster
path.data: esdata
path.repo: essnapshot/snapshots
path.logs: tomcat8/logs
http.port: 9220
http.host: localhost
http.enabled: true
http.cors.enabled: false
transport.tcp.port: 9320

# Manual discovery
network.host: 10.0.1.116
discovery.zen.ping.unicast.hosts: ["10.0.1.116:9310", "10.0.1.116:9320", "10.0.1.116:9330", "10.0.1.116:9340"]
-------
AUTOWIRE_CLUSTER_ES=false

In this case the configuration is honored and all the nodes join correctly to the cluster, however the cluster_server table doesn't have the right information:

dotcms501=> SELECT * FROM cluster_server;
              server_id               |              cluster_id              |               name               | ip_address | host | cache_port | es_transport_tcp_port | es_network_port | es_http_port | key_
--------------------------------------+--------------------------------------+----------------------------------+------------+------+------------+-----------------------+-----------------+--------------+------
 caddd7ad-0ad2-4809-b989-184143a51d3d | f30a4e76-4d07-402b-944b-24fd929e9ac0 | test-cms1.eng.dotcmscloud.net | 10.0.1.116 |      |       5701 |                  9300 |                 |         9200 | n/a
 c82c4eb0-8bc0-4ab2-bb77-a6fb4f5376d0 | f30a4e76-4d07-402b-944b-24fd929e9ac0 | test-cms1.eng.dotcmscloud.net | 10.0.1.116 |      |       5702 |                  9300 |                 |         9200 | n/a
 f1f9fa1d-a841-4fbe-8818-c6b07ce85081 | f30a4e76-4d07-402b-944b-24fd929e9ac0 | test-cms1.eng.dotcmscloud.net | 10.0.1.116 |      |       5703 |                  9300 |                 |         9200 | n/a
 0c7abed3-5804-4817-a05b-9703c1054600 | f30a4e76-4d07-402b-944b-24fd929e9ac0 | test-cms1.eng.dotcmscloud.net | 10.0.1.116 |      |       5704 |                  9300 |                 |         9200 | n/a
(4 rows)

Possible Solution

Known Workarounds

Steps to Reproduce (for bugs)

  1. Configure dotCMS using the settings below (auto-wire or manual)
  2. Startup dotCMS, on auto-wire the configuration is not honored

Context

Your Environment

  • dotCMS version used: 5.0.1
  • Browser Name and version: N/A
  • Operating System and version: Amazon Linux
  • Application Server and version: Embedded Tomcat 8.5.32
  • Java Brand and version: openjdk version "1.8.0_181"
  • Database and version: Postgresql 9.6
  • Application module (if apply): N/A

vianneychacon avatar Sep 13 '18 11:09 vianneychacon

We were able to modify this in 4.x even when using auto-wire. According to this comment it should be possible in 5.x too

vianneychacon avatar Sep 13 '18 14:09 vianneychacon

PR: https://github.com/dotCMS/core/pull/15374

dsilvam avatar Oct 03 '18 21:10 dsilvam

Working as it should now. It not longer re-wires to the default values.

erickgonzalez avatar Oct 09 '18 16:10 erickgonzalez

Fixed, tested on release-5.0.3, the properties are as indicate in the card description, and the auto-wire works as expected,

bryanboza avatar Nov 08 '18 19:11 bryanboza