|
@ -76,8 +76,8 @@ public class ElasticFactory {
|
|
private synchronized void initTranClient() throws UnknownHostException {
|
|
private synchronized void initTranClient() throws UnknownHostException {
|
|
if (transportClient == null) {
|
|
if (transportClient == null) {
|
|
Settings settings = Settings.settingsBuilder()
|
|
Settings settings = Settings.settingsBuilder()
|
|
.put("client.transport.sniff", true)
|
|
|
|
.put("cluster.name", StringUtils.isEmpty(clusterName) ? "jkzl" : clusterName)
|
|
|
|
|
|
.put("client.transport.sniff", true)//开启嗅探功能
|
|
|
|
.put("cluster.name", StringUtils.isEmpty(clusterName) ? "jkzl" : clusterName)//默认集群名字是jkzl
|
|
.build();
|
|
.build();
|
|
|
|
|
|
transportClient = TransportClient.builder().settings(settings).build()
|
|
transportClient = TransportClient.builder().settings(settings).build()
|