Kevin
Kevin

Reputation: 91

NoNodeAvailableException when installing elasticsearch plugin in grails

I'm developing a grails web-app (currently on my local machine) that needs to query elasticsearch on a server on my network.

I have taken the following steps:

Added the following line in BuildConfig.groovy

plugins {
        ...
        runtime ":elasticsearch:0.0.3.4"
        ...
    }

I have also added the following to Config.groovy:

elasticSearch {
    client.mode = 'transport'
    client.hosts = [
        [host:'xxx.xxx.xxx.xxx', port:9200]
    ]
    disableAutoIndex = 'true'
}

To eliminate firewall issues etc have run the query using curl and it works fine:

curl -XGET 'http://xxx.xxx.xxx.xxx:9200/_search?pretty' -d '{...}

But I am getting the following:

|Running Grails application
Error |
2014-10-23 09:17:52,278 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: Error creating bean with name 'searchableClassMappingConfigurator': Invocation of init method failed; nested exception is org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
Message: Error creating bean with name 'searchableClassMappingConfigurator': Invocation of init method failed; nested exception is org.elasticsearch.client.transport.NoNodeAvailableException: None of the configured nodes are available: []
    Line | Method
->>  262 | run       in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
Caused by NoNodeAvailableException: None of the configured nodes are available: []
->>  273 | ensureNodesAreAvailable in org.elasticsearch.client.transport.TransportClientNodesService
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    192 | execute   in     ''
|     81 | execute . in org.elasticsearch.client.transport.support.InternalTransportClusterAdminClient
|     73 | execute   in     ''
|    118 | health .  in org.elasticsearch.client.support.AbstractClusterAdminClient
|    154 | installMappings in org.grails.plugins.elasticsearch.mapping.SearchableClassMappingConfigurator
|     51 | configureAndInstallMappings in     ''
|    262 | run       in java.util.concurrent.FutureTask
|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run . . . in java.lang.Thread
Error |
Forked Grails VM exited with error

I've read numerous other answers on here for similar errors but nothing I've tried is working. Any ideas?

Upvotes: 1

Views: 1571

Answers (1)

cfrick
cfrick

Reputation: 37008

Transport is done on port 9300 (not on the HTTP port 9200). Also check this port to be open then.

If it still fails, check also to use the right cluster.name. It is elasticsearch by default, so if you have not changed it in your server/cluster, there is no need for it.

Otherwise please add the new insights on your question.

Upvotes: 3

Related Questions