基于群集名称/ https URL / DNS名称

时间:2015-12-04 13:10:02

标签: elasticsearch jest

需要知道Jest客户端的实现是否可用于Https URL(不是http-因为它可用),或仅基于群集名称或基于DNS名称访问Jest客户端。

建议我,如果我不知道这些实现。

在Git中心开启了问题:https://github.com/searchbox-io/Jest/issues/270

编辑:

根据以下参考文章,https://github.com/searchbox-io/Jest/blob/master/jest/README.md
很明显Jest支持Https / SSL连接。

只是想知道它是否可以支持基于群集名称的配置,即不提供主机或端口详细信息?

1 个答案:

答案 0 :(得分:0)

我使用的是Jest客户端版本0.1.4。此版本未引入代理和SSL配置。

但是使用以下代码,能够成功访问群集URL而不提供主机和端口详细信息。

List<String> connectionUri = new ArrayList<String>();
connectionUri.add("https://search-testing.es.samplews.com");

jestFactory.setHttpClientConfig(new HttpClientConfig
.Builder(connectionUri)
.maxTotalConnection(maxTotalConnection)
.readTimeout(readTimeout)
.connTimeout(connTimeout)
.multiThreaded(true)
.build());

值:

maxTotalConnection = 50, readTimeout=60000, connTimeout=60000