线程“main”中的异常java.lang.IllegalStateException:未配置path.home 在org.elasticsearch.env.Environment。(Environment.java:101) at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareEnvironment(InternalSettingsPreparer.java:81) 在org.elasticsearch.node.Node。(Node.java:128) 在org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145) 在org.elasticsearch.node.NodeBuilder.node(NodeBuilder.java:152) 在JavaAPIMain.main(JavaAPIMain.java:43)
//使用java
将文档添加到elasticsearch Node node = nodeBuilder().clusterName("myapplication").node();
Client client = node.client();
client.prepareIndex("kodcucom", "article", "1")
.setSource(putJsonDocument("ElasticSearch: Java",
"ElasticSeach provides Java API, thus it executes all operations " +
"asynchronously by using client object..",
new Date(),
new String[]{"elasticsearch"},
"Hüseyin Akdoğan")).execute().actionGet();
答案 0 :(得分:1)
尝试这个怎么样:
NodeBuilder.nodeBuilder()
.settings(Settings.builder()
.put("path.home", "/path/to/elasticsearch/home/dir")
.node();
致谢:https://github.com/elastic/elasticsearch/issues/15325
首先向Google询问您的错误消息。您的问题有超过5k的结果。
答案 1 :(得分:0)
如果你正在使用intellij或eclipse, 编辑配置并在VMoptions中添加以下行
-Des.path.home = {dropwizard安装目录}
例如在我的mac
中-Des.path.home = /用户/ supreeth.vp / elasticsearch-2.3.4 / bin中