Search code examples
groovygrails-pluginelasticsearch-plugin

How I can set my elasticsearh port to 9300?


I am trying to set my elasticsearh port to 9300 but when I set http.port to 9300 elasticsearch not work. Actually I'm develop a grails web-app using an elasticsearch instance but when i run the app the following error appear

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: []

I have read other answer but no one have resolve my problem. Any ideas??

My config file is:

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

Now, grails show me the following error:

[localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: No datastore implementation specified Message: No datastore implementation specified
 Line | Method
 ->>  135 | doCall                    in    ElasticsearchGrailsPlugin$_closure1
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 |    754 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
 |    584 | beans . . . . . . . . . . in     ''
 |    527 | invokeMethod              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

Really I surfed in web but i didnt find a solution to this problem, I need connect to an ES instance. Thanks in advanced. Sorry for my english.


Solution

  • In my Cofig.groovy file I add next code:

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

    And change the disableAutoIndex to true in the DefaultElasticSearch.groovy file and work. Thanx.