---
title: "spring boot 2.14版本不支持  elasticsearch transportClient"
author: "ch_dj"
date: "2019-06-21T09:48:02Z"
tags: []
categories: ["编程语言"]
slug: "spring-boot-2-14-elasticsearch-transportclient"
draft: false
lastmod: "2019-06-21T09:48:02Z"
id: 2442029
url: "https://ch-dj.iteye.com/blog/2442029"
---

spring boot 2.1.4 不支持 

```
 @Bean
    public TransportClient getTransportClient() throws Exception {
        
        Settings esSettings = Settings.builder()
            .put("cluster.name", "canales")//集群名字
            .put("client.transport.sniff", false)//增加嗅探机制，找到ES集群
            .build();
        transportClient = new PreBuiltTransportClient(esSettings);
        transportClient.addTransportAddress(new TransportAddress(InetAddress.getByName(host),Integer.valueOf(port)));
        
        logger.info("canales transportClient 连接成功");
        return transportClient;
    }
```

 

 

目前是  1.5.6

 

解决：