dadoonet/spring-elasticsearch

Working with version Spring -elastic 1.4.2 and elastic search 1.7.1

Closed this issue · 5 comments

Giving esClient like

<elasticsearch:client id="esClient" esNodes="localhost:9300,localhost:9301" properties="esProperties"/>

and esProperties like

<util:map id="esProperties">
        <entry key="cluster.name" value="myCluster"/>
</util:map>

But getting

None of the configured nodes are available: []
 Caused by: org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []

If you format your code, that'd be easier to read. I updated your question.

Do you have a node running? What is the cluster name?

Thanks for very quick response.
My Node is running in the same machine. cluster name is myCluster.
I have simply injected this esClient into my Spring component. but it is giving above exceptions during startup only.

When I am trying to create the client like below I am able to find he running node

Settings settings = ImmutableSettings.settingsBuilder()
                .put("cluster.name","myCluster").build();
        TransportClient client = new TransportClient(settings);
        client.addTransportAddress(new InetSocketTransportAddress("localhost",9300));

@Vijendra07Kulhade Did you manage to solve it?

Yes It started working for me after I removed all properties. I just gave cluster name in properties.