1

ネットワーク上のサーバーでelasticsearchを照会する必要があるgrails Webアプリ(現在ローカルマシン上)を開発しています。

次の手順を実行しました。

BuildConfig.groovy に次の行を追加しました

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

また、Config.groovy に以下を追加しました。

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

ファイアウォールの問題などを解消するために、curl を使用してクエリを実行すると、正常に動作します。

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

しかし、私は以下を取得しています:

|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

同様のエラーについて、ここで他の多くの回答を読みましたが、私が試したものは何も機能していません。何か案は?

4

1 に答える 1