ELKF:ELKF 安装可能遇到的问题

本文章将持续更新 记录所遇到的问题及解决方案 ... ↓ ↓ 

本次使用版本为:7.3.0 (以下问题 7.x 版本后都有可能遇到)

1):问题 一

ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
ERROR: Elasticsearch did not exit normally - check the logs at /opt/app/elasticsearch-7.7.0/logs/MyES.log

查看机器限制:

ulimit -Sn
ulimit -Hn

修改限制:

vim /etc/security/limits.conf
*       soft    nofile           65535
*       hard    nofile           65535
elk       soft    nproc           4096
elk       hard    nproc           4096
vim /etc/sysctl.conf
vm.swappiness = 0
vm.max_map_count=262144

执行命令sysctl -p另其生效。

2):问题二 :Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.

[root@ncx bin]# Exception in thread "main" java.lang.RuntimeException: don't run elasticsearch as root.
        at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:93)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:144)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.

原因:

出于系统安全考虑的设置 ,不允许root账号启动

解决:

创建一个新用户,用于启动elasticsearch
实操:
1)创建新用户es
    useradd es
2)赋予es用户elasticsearch目录权限
    chown -R es .../elasticsearch
3)切换至用户es
    su es
4)启动elasticsearch

3):问题三:修改指定 JDK

future versions of Elasticsearch will require Java 11; your Java version from [/opt/java/jdk/jdk1.8.0_191/jre] does not meet this requirement
Exception in thread "main" java.nio.file.AccessDeniedException: /opt/java/elkf/es/install/elasticsearch-7.3.0/config/jvm.options
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.Files.newByteChannel(Files.java:407)
    at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
    at java.nio.file.Files.newInputStream(Files.java:152)
    at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:61)

原因:

#这是由于在elastic 到7.0之后 默认要使用JDK11以上 但是我们平时开发使用的一般都是JDK1.8,所以导致启动不成功
#elastic 7.2之后就自带JDK 我们可以再不改名系统本身环境变量的同时,使用elastic自身的JDK
#需要修改elastic的启动文件

解决:

vim bin/elasticsearch

#配置为elasticsearch自带jdk
export JAVA_HOME=/usr/local/nlp/elasticsearch-7.9.1/jdk
export PATH=$JAVA_HOME/bin:$PATH

#添加jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
        JAVA="/usr/local/nlp/elasticsearch-7.9.1/jdk/bin/java"
else
        JAVA=`which java`
fi

4):问题四  Kibana server is not ready yet

说明kibana与Elasticsearch版本号不一致

# 查看版本号

rpm -qa elasticsearch kibana

 

posted @ 2021-09-12 21:40  coding++  阅读(139)  评论(0编辑  收藏  举报