首先elasticsearch和kibana下载地址:下载中心 - Elastic 中文社区
问题1:Elasticsearch requires at least Java 11 but your Java version from XXXX does not meet this requirement”
elasticsearch在7以上要求jdk为11以上,但是开发一般使用jkd 8,此时莫慌,elasticsearch自己带有适合的jdk,修改以下文件:
# now set the path to java
if [ ! -z "$JAVA_HOME" ]; then
JAVA="$JAVA_HOME/bin/java"
JAVA_TYPE="JAVA_HOME"
else
if [ "$(uname -s)" = "Darwin" ]; then
# macOS has a different structure
JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
else
JAVA="$ES_HOME/jdk/bin/java"
fi
JAVA_TYPE="bundled jdk"
fi
修改成:
# now set the path to java
if [ ! -z "$JAVA_HOME" ]; then
JAVA="$ES_HOME/jdk/bin/java" <----------------注意修改的地方
JAVA_TYPE="bundled jdk" <----------------注意修改的地方
else
if [ "$(uname -s)" = "Darwin" ]; then
# macOS has a different structure
JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
else
JAVA="$ES_HOME/jdk/bin/java"
fi
JAVA_TYPE="bundled jdk"
fi
然后重新执行 ./bin/elasticsearch 可能会出现下面问题
问题2:[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
解决办法:
vim /etc/security/limits.conf
添加
- soft nofile 65536 --------注意 * 号也需要
- hard nofile 65536
来回切换下用户,使之生效;或者关闭连接重新连接。
问题3:[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决办法:
vim /etc/sysctl.conf
添加:
vm.max_map_count=262144
保存后,执行:
sysctl -p
重新启动,成功。
版权归原作者 消巴哥 所有, 如有侵权,请联系我们删除。