I'm migrating to Elasticsearch 5 from 2 and we have integration tests which run on build servers which do not have ES nodes available. We have used the NodeBuilder from the previous version of ES to create in memory nodes on demand, but I can't find how to do the same thing with version 5.
First time posting in stack overflow, sorry if any mistake in how ask my question.
I had exactly the same problem where I start a client in memory, but I could not connect using the transport client having NoNodeAvailableException as error message.
Settings settings = Settings.builder()
.put("path.home", "target/elasticsearch")
.put("transport.type", "local")
.put("http.enabled", false)
.build();
node = new Node(settings).start();
Now in my test I inject node().client() to the repository and it worked.
For whole code, spring boot and ES 5 without spring-data which does not support ES 5: https://github.com/jomilanez/elastic5
NodeBuilder
is removed from the API in ES 5 and the same thing can be achieved adding "transport.type" "local" to the settings and creating a node with
new Node(settings).start().client()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With