【发布时间】:2017-12-20 05:47:27
【问题描述】:
我是 JEST 技术的新手。我正在通过https://github.com/searchbox-io/Jest/tree/master/jest#authentication 链接练习它。我能够创建索引并向其添加文档,但我想传递多个节点。
这是我的代码
JestClientFactory factory = new JestClientFactory();
factory.setHttpClientConfig(new HttpClientConfig
.Builder("http://192.167.1.2:9200")
.defaultCredentials("user", "password")
.multiThreaded(false)
//Per default this implementation will create no more than 2 concurrent connections per given route
.defaultMaxTotalConnectionPerRoute(2) // and no more 20 connections in total
.maxTotalConnection(5)
.build());
JestClient client = factory.getObject();
我有 3 个节点的集群,所以我想在代码中传递 3 个节点。任何帮助将不胜感激。
谢谢
【问题讨论】:
标签: elasticsearch elasticsearch-jest