我在debian jessie上安装elasticsearch 1.7.3。它使用默认配置文件并正常工作。但是当我调用sudo /usr/share/elasticsearch/bin/plugin
时,它会返回错误:
Exception in thread "main" org.elasticsearch.env.FailedToResolveConfigException: Failed to resolve config path ["/usr/share/elasticsearch/config/elasticsearch.yml"], tried file path ["/usr/share/elasticsearch/config/elasticsearch.yml"], path file ["/usr/share/elasticsearch/config"/"/usr/share/elasticsearch/config/elasticsearch.yml"], and classpath
at org.elasticsearch.env.Environment.resolveConfig(Environment.java:291)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:95)
at org.elasticsearch.plugins.PluginManager.main(PluginManager.java:396)
文件/usr/share/elasticsearch/config/elasticsearch.yml
已存在,我可以用nano打开他。
有/ etc / default / elasticsearch文件:
# Start Elasticsearch automatically
START_DAEMON=true
# Run Elasticsearch as this user ID and group ID
#ES_USER=elasticsearch
#ES_GROUP=elasticsearch
# Heap Size (defaults to 256m min, 1g max)
#ES_HEAP_SIZE=2g
# Heap new generation
#ES_HEAP_NEWSIZE=
# max direct memory
#ES_DIRECT_SIZE=
# Maximum number of open files, defaults to 65535.
#MAX_OPEN_FILES=65535
# Maximum locked memory size. Set to "unlimited" if you use the
# bootstrap.mlockall option in elasticsearch.yml. You must also set
# ES_HEAP_SIZE.
#MAX_LOCKED_MEMORY=unlimited
# Maximum number of VMA (Virtual Memory Areas) a process can own
#MAX_MAP_COUNT=262144
# Elasticsearch log directory
#LOG_DIR=/var/log/elasticsearch
# Elasticsearch data directory
#DATA_DIR=/var/lib/elasticsearch
# Elasticsearch work directory
#WORK_DIR=/tmp/elasticsearch
# Elasticsearch configuration directory
#CONF_DIR=/etc/elasticsearch
# Elasticsearch configuration file (elasticsearch.yml)
#CONF_FILE=/etc/elasticsearch/elasticsearch.yml
# Additional Java OPTS
#ES_JAVA_OPTS=
# Configure restart on package upgrade (true, every other setting will lead to not restarting)
#RESTART_ON_UPGRADE=true
/var/log/elasticsearch/elasticsearch.log
和/var/log/elasticsearch/elasticsearch.error
个文件中没有记录。
有人知道为什么会失败吗?
答案 0 :(得分:15)
这不是问题的决心。但我解决了我的问题。
/usr/share/elasticsearch/bin/plugin
中的脚本生成bash-command并运行它。我编辑了这个文件。它由echo
打印此命令而不是运行它。我复制了这个命令并从丛林终端运行它。它运行正常。
我不知道为什么但它有效。可能会对某人有所帮助。
答案 1 :(得分:2)
我也遇到了同样的问题 - 2016年9月。原来,弹出搜索的旧版本(即1.7.3)会出现此问题,该版本位于 Ubuntu 的回购中。使用当前的(无论如何推荐),你不应该得到这个错误。
要安装当前版本(编写此版本,版本为2.4),请按照these steps:
<div class="accordian">
<ul>
<li>
<div class="image_title">
<a href="#">Event 1</a>
</div>
<a href="#">
<img src="https://images.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.wallpaperup.com%2Fuploads%2Fwallpapers%2F2015%2F01%2F30%2F606369%2F5510b472cf9126e305bb941e8ec8d9e8.jpg&f=1" />
</a>
</li>
<li>
<div class="image_title">
<a href="#">Event 2</a>
</div>
<a href="#">
<img src="https://images.duckduckgo.com/iu/?u=https%3A%2F%2Fwww.betaseries.com%2Fimages%2Ffonds%2Foriginal%2F9296_1415901083.jpg&f=1" />
</a>
</li>
<li>
<div class="image_title">
<a href="#">Event 3</a>
</div>
<a href="#">
<img src="https://images.duckduckgo.com/iu/?u=http%3A%2F%2Fwww.wallpaperup.com%2Fuploads%2Fwallpapers%2F2015%2F01%2F30%2F606369%2F5510b472cf9126e305bb941e8ec8d9e8.jpg&f=1" />
</a>
</li>
</ul>
</div>
答案 2 :(得分:2)
这些更改为我解决了这个问题:
--- /usr/share/elasticsearch/bin/plugin 2015-12-24 05:14:52.000000000 +0000
+++ /usr/share/elasticsearch/bin/pluginfix 2018-04-21 22:54:49.547134959 +0000
@@ -79,7 +79,7 @@
properties="$properties \"$var\"=\"$1\""
;;
*)
- args="$args \"$1\""
+ args="$args $1"
esac
shift
done
@@ -90,7 +90,7 @@
*-Des.default.path.conf=*|*-Des.path.conf=*)
;;
*)
- properties="$properties -Des.default.path.conf=\"$CONF_DIR\""
+ properties="$properties -Des.default.path.conf=$CONF_DIR"
;;
esac
fi
@@ -100,11 +100,11 @@
*-Des.default.config=*|*-Des.config=*)
;;
*)
- properties="$properties -Des.default.config=\"$CONF_FILE\""
+ properties="$properties -Des.default.config=$CONF_FILE"
;;
esac
fi
export HOSTNAME=`hostname -s`
-exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home=\""$ES_HOME"\" $properties -cp \""$ES_CLASSPATH"\" org.elasticsearch.plugins.PluginManager $args
+exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home="$ES_HOME" $properties -cp "$ES_CLASSPATH" org.elasticsearch.plugins.PluginManager $args
Pikaev Viktor发布的解决方法基本上应用了同样的解决方案。通过复制粘贴将由脚本执行的命令的操作,shell将删除一级引号对。
此错误也已报告给 Ubuntu Debian(请参阅https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807596),但已被标记为无法修复,因为:
...包弹性搜索刚刚从Debian存档中删除不稳定...
截至2018年3月11日。
答案 3 :(得分:0)
尝试此步骤[为我工作]:
1.运行 elasticsearch
2.检查 ps aux | grep elast
你会得到像你这样的东西
elastic+ 12723 4.3 25.7 4623016 261176 ? Sl 13:27 0:22 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.pidfile=/var/run/elasticsearch.pid -Des.path.home=/usr/share/elasticsearch -cp :/usr/share/java/lucene-replicator-4.10.4.jar:/usr/share/java/lucene-facet-4.10.4.jar:/usr/share/java/lucene-analyzers-morfologik-4.10.4.jar:/usr/share/java/lucene-analyzers-kuromoji-4.10.4.jar:/usr/share/java/lucene-join-4.10.4.jar:/usr/share/java/lucene-suggest-4.10.4.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/log4j-1.2-1.2.17.jar:/usr/share/java/jts.jar:/usr/share/java/lucene-expressions-4.10.4.jar:/usr/share/java/spatial4j-0.4.1.jar:/usr/share/java/lucene-highlighter-4.10.4.jar:/usr/share/java/sigar.jar:/usr/share/java/lucene-memory-4.10.4.jar:/usr/share/java/lucene-analyzers-icu-4.10.4.jar:/usr/share/java/lucene-misc-4.10.4.jar:/usr/share/java/lucene-analyzers-smartcn-4.10.4.jar:/usr/share/java/lucene-benchmark-4.10.4.jar:/usr/share/java/lucene-analyzers-phonetic-4.10.4.jar:/usr/share/java/lucene-analyzers-uima-4.10.4.jar:/usr/share/java/lucene-sandbox-4.10.4.jar:/usr/share/java/lucene-classification-4.10.4.jar:/usr/share/java/elasticsearch-1.7.3.jar:/usr/share/java/groovy-all-2.x.jar:/usr/share/java/lucene-test-framework-4.10.4.jar:/usr/share/java/lucene-codecs-4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/java/apache-log4j-extras-1.2.17.jar:/usr/share/java/jna.jar:/usr/share/java/lucene-spatial-4.10.4.jar:/usr/share/java/lucene-queries-4.10.4.jar:/usr/share/java/lucene-analyzers-stempel-4.10.4.jar:/usr/share/java/lucene-analyzers-common-4.10.4.jar:/usr/share/java/lucene-demo-4.10.4.jar:/usr/share/java/lucene-grouping-4.10.4.jar: -Des.default.config=/etc/elasticsearch/elasticsearch.yml -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=/etc/elasticsearch org.elasticsearch.bootstrap.Elasticsearch
4.现在使用
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Delasticsearch -Des.pidfile=/var/run/elasticsearch.pid -Des.path.home=/usr/share/elasticsearch -cp :/usr/share/java/lucene-replicator-4.10.4.jar:/usr/share/java/lucene-facet-4.10.4.jar:/usr/share/java/lucene-analyzers-morfologik-4.10.4.jar:/usr/share/java/lucene-analyzers-kuromoji-4.10.4.jar:/usr/share/java/lucene-join-4.10.4.jar:/usr/share/java/lucene-suggest-4.10.4.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/log4j-1.2-1.2.17.jar:/usr/share/java/jts.jar:/usr/share/java/lucene-expressions-4.10.4.jar:/usr/share/java/spatial4j-0.4.1.jar:/usr/share/java/lucene-highlighter-4.10.4.jar:/usr/share/java/sigar.jar:/usr/share/java/lucene-memory-4.10.4.jar:/usr/share/java/lucene-analyzers-icu-4.10.4.jar:/usr/share/java/lucene-misc-4.10.4.jar:/usr/share/java/lucene-analyzers-smartcn-4.10.4.jar:/usr/share/java/lucene-benchmark-4.10.4.jar:/usr/share/java/lucene-analyzers-phonetic-4.10.4.jar:/usr/share/java/lucene-analyzers-uima-4.10.4.jar:/usr/share/java/lucene-sandbox-4.10.4.jar:/usr/share/java/lucene-classification-4.10.4.jar:/usr/share/java/elasticsearch-1.7.3.jar:/usr/share/java/groovy-all-2.x.jar:/usr/share/java/lucene-test-framework-4.10.4.jar:/usr/share/java/lucene-codecs-4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/java/apache-log4j-extras-1.2.17.jar:/usr/share/java/jna.jar:/usr/share/java/lucene-spatial-4.10.4.jar:/usr/share/java/lucene-queries-4.10.4.jar:/usr/share/java/lucene-analyzers-stempel-4.10.4.jar:/usr/share/java/lucene-analyzers-common-4.10.4.jar:/usr/share/java/lucene-demo-4.10.4.jar:/usr/share/java/lucene-grouping-4.10.4.jar: -Des.default.config=/etc/elasticsearch/elasticsearch.yml -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=/etc/elasticsearch
作为命令和做(例如):
$ command org.elasticsearch.plugins.PluginManager -i elasticsearch / elasticsearch-analysis-stempel
或检查帮助 $ command org.elasticsearch.plugins.PluginManager -h