elasticsearch,Playframework 2.0,elasticsearch" /> elasticsearch,Playframework 2.0,elasticsearch" />

Playframework 2.0 Play2 play dist上的elasticsearch错误

Playframework 2.0 Play2 play dist上的elasticsearch错误,playframework-2.0,elasticsearch,Playframework 2.0,elasticsearch,我正在使用Play2ElasticSearchPlugin(),在开发模式下工作正常,但当我运行PlayDist并打包应用程序时,在运行该应用程序后,不会创建索引 以下是stacktrace: [错误]应用程序-ElasticSearch:启动ElasticSearch客户端时出错 org.elasticsearch.ElasticSearchIllegalStateException:无法获取节点锁,以下位置是否可写?:[data/play2 elasticsearch] 在org.elast

我正在使用Play2ElasticSearchPlugin(),在开发模式下工作正常,但当我运行PlayDist并打包应用程序时,在运行该应用程序后,不会创建索引

以下是stacktrace:

[错误]应用程序-ElasticSearch:启动ElasticSearch客户端时出错 org.elasticsearch.ElasticSearchIllegalStateException:无法获取节点锁,以下位置是否可写?:[data/play2 elasticsearch] 在org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:123)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.internal.InternalNode.(InternalNode.java:139)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在com.github.cleverage.elasticsearch.IndexClient.start(IndexClient.java:36)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 在com.github.cleverage.elasticsearch.plugin.IndexPlugin.onStart(IndexPlugin.java:47)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 原因:java.io.IOException:无法获得/Users/Nicolas/IdeaProjects/lavidaporloscolores/target/universal/stage/data/play2 elasticsearch/nodes/49上的锁定 在org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:102)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.internal.InternalNode.(InternalNode.java:139)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在com.github.cleverage.elasticsearch.IndexClient.start(IndexClient.java:36)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 在com.github.cleverage.elasticsearch.plugin.IndexPlugin.onStart(IndexPlugin.java:47)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 原因:java.io.IOException:无法创建目录:/Users/Nicolas/IdeaProjects/lavidaporloscolores/target/universal/stage/data/play2 elasticsearch/nodes/49 获取(NativeFSLockFactory.java:171)~[org.apache.lucene.lucene-core-4.4.0.jar:4.4.0 1504776-sarowe-2013-07-19 02:53:42] 在org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:80)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.internal.InternalNode.(InternalNode.java:139)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:159)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:166)~[org.elasticsearch.elasticsearch-0.90.5.jar:na] 在com.github.cleverage.elasticsearch.IndexClient.start(IndexClient.java:36)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] [错误]应用程序-ElasticSearch:索引准备期间发生意外异常。尚未创建和准备索引。 java.lang.NullPointerException:null 在com.github.cleverage.elasticsearch.IndexService.existsIndex(IndexService.java:378)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 在com.github.cleverage.elasticsearch.plugin.IndexPlugin.onStart(IndexPlugin.java:58)~[com.clever age.play2-elasticsearch-0.8-SNAPSHOT.jar:0.8-SNAPSHOT] 在play.api.play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(play.scala:88)[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 在play.api.play$$anonfun$start$1$$anonfun$apply$mcV$sp$1.apply(play.scala:88)[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0] 位于scala.collection.immutable.List.foreach(List.scala:318)[org.scala-lang.scala-library-2.10.2.jar:na] 在play.api.play$$anonfun$start$1.apply$mcV$sp(play.scala:88)[com.typesafe.play.play_2.10-2.2.0.jar:2.2.0]

有什么想法吗?感谢您找到了解决方案:

在application.conf上添加此行:

  • elasticsearch.config.resource=elasticsearch.yml
创建此文件conf/elasticsearch.yml并添加

  • path.data:/Users/Nicolas/IdeaProjects/lavidaporloscolores/elasticsearchdata

完成此操作后,我必须再次运行“play dist”以使play阅读我的新配置文件

您能在问题中添加您使用的模块配置吗?谢谢mguillermin,请查看我的新帖子并给出答案。谢谢你的时间