Failed to initialize connection: None of the configured nodes were available


(Sravan Kumar) #1

I am trying to connect to my local elastic search instance by using the elastic 4s library

val esSettings = Settings.builder().put("cluster.name", "cluster name").build()
val esClient = TcpClient.transport(esSettings,ElasticsearchClientUri(host:port))

and trying to bulk insert using

esClient.execute {
bulk(
//bulk insert code here
)
}

esClient.close()

this piece of code is existing in an application (whose process is always up).
The connection is getting established for the first time that we run this, but if we try to run the second time (without killing the application) it fails with
Failed to initialize connection: None of the configured nodes were available [{uhAnU8f}{uhAnU8fuSU23apQDfGCPXA}{BXaLbIxSSeWiL6tqAbHpMg}{127.0.0.1}{127.0.0.1:9330}]

But when I restart the entire process, the connection is successful for first time and fails the second time.
i.e the connection is only lasting for one bulk insert, if i try to re-establish the connection after closing, it fails with no configured nodes available.
Is there any other way other than esClient.close() to close the client or any other ways to open..


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.