gpt4 book ai didi

playframework-2.0 - Play dist上的Play2 elasticsearch错误

转载 作者:行者123 更新时间:2023-12-03 02:08:55 26 4
gpt4 key购买 nike

我正在使用play 2 Elasticsearch 插件(https://github.com/cleverage/play2-elasticsearch),并且在开发模式下可以正常运行,但是当我运行play dist并打包应用程序时,在我运行它后不会创建索引。

这是堆栈跟踪:

[错误]应用程序-ElasticSearch:启动ElasticSearch Client时出错
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
在org.apache.lucene.store.NativeFSLock.obtain(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:空
在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”以使播放读取我的新配置文件

    关于playframework-2.0 - Play dist上的Play2 elasticsearch错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19672749/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com