From 725468f8a257c1ec60b7535c537ff407bfce8fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=A4=E7=8B=90=E5=B0=91=E4=BE=A0?= Date: Sun, 1 Dec 2019 13:06:32 +0800 Subject: [PATCH] Fix bug of getting ES host error (#2342) --- fe/src/main/java/org/apache/doris/external/EsRestClient.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fe/src/main/java/org/apache/doris/external/EsRestClient.java b/fe/src/main/java/org/apache/doris/external/EsRestClient.java index 7f9b7bc0ad..e63a7af58d 100644 --- a/fe/src/main/java/org/apache/doris/external/EsRestClient.java +++ b/fe/src/main/java/org/apache/doris/external/EsRestClient.java @@ -110,6 +110,11 @@ public class EsRestClient { // maybe should add HTTP schema to the address // actually, at this time we can only process http protocol + // NOTE. currentNode may have some spaces. + // User may set a config like described below: + // hosts: "http://192.168.0.1:8200, http://192.168.0.2:8200" + // then currentNode will be "http://192.168.0.1:8200", " http://192.168.0.2:8200" + currentNode = currentNode.trim(); if (!(currentNode.startsWith("http://") || currentNode.startsWith("https://"))) { currentNode = "http://" + currentNode; }