Skip to content
Advertisement

Elasticsearch stops working after I run the springboot Java program and elasticsearch transport node is not loading in my Java Program

Elasticsearch version 8.1.3 Java version 1.8

Im trying to connect elasticsearch with Java springboot program. My Elasticsearch works fine until I run the Java program, also my java program works fine but with “.d.e.r.s.AbstractElasticsearchRepository : failed to load elasticsearch nodes : org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: [{#transport#-1}{LsJSQJtCS56wr7IM_S0h4Q}{localhost}{127.0.0.1:9300}]” on springboot error. Also, as soon as I run my program as java application elasticsearch stops working with “[WARN ][o.e.x.c.s.t.n.SecurityNetty4Transport] [DESKTOP-ADQ0I0S] received plaintext traffic on an encrypted channel, closing connection Netty4TcpChannel{localAddress=/127.0.0.1:9300, remoteAddress=/127.0.0.1:59255, profile=default}

My pom.xml file

JavaScript

Application.properties file

JavaScript

Output of my java program

JavaScript

Error I get on elasticsearch terminal as soon as I run the Java program

JavaScript

To access Elasticsearch with Java I have followed this YouTube video tutorial [1]: https://www.youtube.com/watch?v=dlChXjE7IHw&t=541s

Also, im not able to add the type and shards parameter in the @Document annotation in my model. it is only accepting

JavaScript

According to the video it should be

JavaScript

elasticsearch.yml file

JavaScript

Advertisement

Answer

I was using transport client 9300 which is deprecated in Elasticsearch 7 and not supported in version 8 and I was using version 8.1.3. Here we can use the supported Elastic version 7.x or use Elasticsearch Java API client. [Elasticsearch Java API Client 8.1.3] Elasticsearch Java API Client 8.1.3

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement