Spring data elasticsearch node-client can't be deployed in Wildfly


(Habib Ali Machpud) #1

Hi All,

I have problem when deploying my elasticsearch application into application server.
I'm using:
-spring-data-jest [2.3.1.RELEASE]
-Wildfly 9 as application server
-Amazon Elasticsearch Service [using Elasticsearch versions 2.3]
Here's the exception https://gist.github.com/bluething/bed0b932059f812fe59f9bf2b27a1500
That exception occur when I deploy to Wildfly. After I googling probably because file under path-home directory still being use by the service, because my Wildfly using hot deployment probably the file still locked.
Here's my elasticsearch xml config https://gist.github.com/bluething/3cdee2544fbea6939b4effb068a446e6

My question:

  1. Is it safe to delete path-home dir for node-client config?
    I want to delete that folder (and sub folder) before deployment.

  2. If deleting path-home dir is not a good idea, what should I do to solve this problem? I can't change deployment process because need more resource to do it.

  3. I don't use any local node, just want to connect to external node (aws service). Why I must set path-home value? Is there any way to delete it from xml config?


(David Pilato) #2

Embedding an elasticsearch node is not supported.

Caused by: java.nio.channels.OverlappingFileLockException: null
        at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255) ~[na:1.8.0_60]
        at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152) ~[na:1.8.0_60]
        at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:1107) ~[na:1.8.0_60]
        at java.nio.channels.FileChannel.tryLock(FileChannel.java:1155) ~[na:1.8.0_60]
        at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:114) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-5.5.2.jar:5.5.2 8e5d40b22a3968df065dfc078ef81cbb031f0e4a - sarowe - 2016-06-21 11:38:23]
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:174) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.Node.<init>(Node.java:165) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.Node.<init>(Node.java:140) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:143) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:150) ~[elasticsearch-2.4.0.jar:2.4.0]
        at org.springframework.data.elasticsearch.client.NodeClientFactoryBean.afterPropertiesSet(NodeClientFactoryBean.java:77) ~[spring-data-elasticsearch-2.1.6.RELEASE.jar:na]

A TransportClient should be used instead as explained at https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client-connected-to-client-node.html
Or a REST Client connected directly to the Client Node as well.

The Client Node is not an embedded Node Client.

I'm not sure what you need to do here but I believe this is the cause of your problem.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.