From 0e89061e1a190b717c6bfcee996c69c8bef94fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Mon, 21 Sep 2020 17:40:34 +0200 Subject: [PATCH 1/2] change transport client settings --- .../java/org/xbib/elx/transport/TransportClientHelper.java | 6 +++--- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java index 5fe7c68..b1e810e 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java @@ -125,9 +125,9 @@ public class TransportClientHelper { .put("cluster.name", settings.get("cluster.name", "elasticsearch")) .put("path.home", settings.get("path.home", ".")) .put("processors", settings.getAsInt("processors", Runtime.getRuntime().availableProcessors())) // for thread pool size - .put("client.transport.sniff", false) // do not sniff - .put("client.transport.nodes_sampler_interval", "1m") // do not ping - .put("client.transport.ping_timeout", "1m") // wait for unresponsive nodes a very long time before disconnect + .put("client.transport.sniff", false) // always disable sniff + .put("client.transport.nodes_sampler_interval", -1) // do not ping, default is 5 seconds + .put("client.transport.ping_timeout", -1) // disable ping unresponsive nodes, defauult is 5 seconds .put("client.transport.ignore_cluster_name", true) // connect to any cluster .build(); } diff --git a/gradle.properties b/gradle.properties index a52e909..6e3a490 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ group = org.xbib name = elx -version = 2.2.1.21 +version = 2.2.1.22 gradle.wrapper.version = 6.4.1 xbib-metrics.version = 2.1.0 From f88992d685530995df45cfdb2a615604e17eb205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=CC=88rg=20Prante?= Date: Mon, 21 Sep 2020 18:33:50 +0200 Subject: [PATCH 2/2] disable pings by default but allow custom settings --- .../org/xbib/elx/transport/TransportClientHelper.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java b/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java index b1e810e..79c26d5 100644 --- a/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java +++ b/elx-transport/src/main/java/org/xbib/elx/transport/TransportClientHelper.java @@ -124,11 +124,11 @@ public class TransportClientHelper { return Settings.builder() .put("cluster.name", settings.get("cluster.name", "elasticsearch")) .put("path.home", settings.get("path.home", ".")) - .put("processors", settings.getAsInt("processors", Runtime.getRuntime().availableProcessors())) // for thread pool size - .put("client.transport.sniff", false) // always disable sniff - .put("client.transport.nodes_sampler_interval", -1) // do not ping, default is 5 seconds - .put("client.transport.ping_timeout", -1) // disable ping unresponsive nodes, defauult is 5 seconds - .put("client.transport.ignore_cluster_name", true) // connect to any cluster + .put("processors", settings.getAsInt("processors", Runtime.getRuntime().availableProcessors())) // for thread pool size / worker count + .put("client.transport.sniff", settings.getAsBoolean("client.transport.sniff", false)) // always disable sniff + .put("client.transport.nodes_sampler_interval", settings.get("client.transport.nodes_sampler_interval", "1h")) // ridculous long ping, default is 5 seconds + .put("client.transport.ping_timeout", settings.get("client.transport.ping_timeout", "1h")) // ridiculous ping for unresponsive nodes, defauult is 5 seconds + .put("client.transport.ignore_cluster_name", settings.getAsBoolean("client.transport.ignore_cluster_name", true)) // connect to any cluster .build(); } }