我在debian jessie上安装了elasticsearch 1.7.3。它使用默认配置文件,并且可以正常工作。但是当我打电话给sudo /usr/share/elasticsearch/bin/plugin它返回一个错误:
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中打开他。
/usr/share/elasticsearch/config/elasticsearch.yml
有/ 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文件中没有记录。
/var/log/elasticsearch/elasticsearch.log
/var/log/elasticsearch/elasticsearch.error
有人知道为什么会失败吗?
这不是问题的解决。但是我解决了我的问题。
/usr/share/elasticsearch/bin/plugin生成bash-command 脚本并运行它。我编辑了这个文件。它通过echo运行该命令来打印此命令。我复制了此命令,并从Bush终端运行了它。它运行正确。
/usr/share/elasticsearch/bin/plugin
echo
我不知道为什么,但是可以。可能会对某人有所帮助。