文档章节

ELK报错及解决方案

o
 osc_g8254g7s
发布于 2019/08/19 20:32
字数 1360
阅读 7
收藏 0

精选30+云产品,助力企业轻松上云!>>>

ELK报错及解决方案

 

1.jdk版本问题

报错如下:

future versions of Elasticsearch will require Java 11; your Java version from [/usr/local/jdk9/jdk-9.0.4] does not meet this requirement
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.

解决方案:

由于Elasticsearch依赖于jdk,es和jdk有着对应的依赖关系。具体可见:
https://www.elastic.co/cn/support/matrix
https://www.elastic.co/guide/en/elasticsearch/reference/7.2/setup.html
这里是说Elasticsearch该版本内置了JDK,而内置的JDK是当前推荐的JDK版本。当然如果你本地配置了JAVA_HOME那么ES就是优先使用配置的JDK启动ES。
ES推荐使用LTS版本的JDK(这里只是推荐,JDK8就不支持),如果你使用了一些不支持的JDK版本,ES会拒绝启动。

根据启动信息我们看到Elasticsearch7.2推荐使用JDK11

jdk下载链接:https://www.oracle.com/technetwork/java/java-se-support-roadmap.html

安装OpenJDK11

[root@ELK1 tar.gz]# pwd
/usr/local/src/tar.gz

#下载 [root@ELK1 tar.gz]# wget https://download.java.net/java/GA/jdk11/13/GPL/openjdk-11.0.1_linux-x64_bin.tar.gz

#加压到指定目录
[root@ELK1 tar.gz]# tar -xzvf jdk-11.0.4_linux-x64_bin.tar.gz /opt/

 

修改配置文件

[root@localhost bin]# vim /home/elk/elasticsearch/-7.2.1/bin/elasticsearch

#配置自己的jdk11
export JAVA_HOME=/opt/jdk-11.0.1
export PATH=$JAVA_HOME/bin:$PATH

#添加jdk判断
if [ -x "$JAVA_HOME/bin/java" ]; then
        JAVA="/opt/jdk-11.0.1/bin/java"
else
        JAVA=`which java`
fi

  

启动ES

[elasticsearch@ELK1 bin]$ ./elasticsearch
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-08-02T15:33:27,994][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [32.6gb], net total_space [35.7gb], types [rootfs]
[2019-08-02T15:33:28,014][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1015.6mb], compressed ordinary object pointers [true]
[2019-08-02T15:33:28,017][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [8zGCWQhBS3OpVShqjSgU-w], cluster name [es-application]
[2019-08-02T15:33:28,017][INFO ][o.e.n.Node               ] [node-1] version[7.2.0], pid[1545], build[default/tar/508c38a/2019-06-20T15:54:18.811730Z], OS[Linux/3.10.0-862.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.1/11.0.1+13]
[2019-08-02T15:33:28,017][INFO ][o.e.n.Node               ] [node-1] JVM home [/opt/jdk-11.0.1]
[2019-08-02T15:33:28,018][INFO ][o.e.n.Node               ] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch-5247006010869253587, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -Dio.netty.allocator.type=unpooled, -XX:MaxDirectMemorySize=536870912, -Des.path.home=/usr/local/src/elasticsearch, -Des.path.conf=/usr/local/src/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]

  

2.启动elasticsearch报错

报错如下:

ERROR: [2] 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]
[2019-08-08T16:04:33,578][INFO ][o.e.n.Node               ] [ELK1] stopping ...
[2019-08-08T16:04:33,591][INFO ][o.e.n.Node               ] [ELK1] stopped
[2019-08-08T16:04:33,592][INFO ][o.e.n.Node               ] [ELK1] closing ...
[2019-08-08T16:04:33,618][INFO ][o.e.n.Node               ] [ELK1] closed
[2019-08-08T16:04:33,621][INFO ][o.e.x.m.p.NativeController] [ELK1] Native controller process has stopped - no new native processes can be started

  

解决方法:

#1、max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

每个进程最大同时打开文件数太小,可通过下面2个命令查看当前数量
ulimit -Hn
ulimit -Sn

修改/etc/security/limits.conf文件,增加配置,用户退出后重新登录生效

*               soft    nofile          65536
*               hard    nofile          65536

#2、max number of threads [3818] for user [es] is too low, increase to at least [4096]

#问题同上,最大线程个数太低。修改配置文件/etc/security/limits.conf,增加配置

*               soft    nproc           4096
*               hard    nproc           4096

#可通过命令查看

ulimit -Hu
ulimit -Su

  

3.在安装elasticsearch-head的过程中npm install报错

报错如下:

[root@ELK1 elasticsearch-head]# npm install 
npm: relocation error: npm: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference

 

解决方法:

升级openssl,执行:
yum update openssl -y

#升级之前版本信息:

[root@ELK1 elasticsearch-head]# openssl version
OpenSSL 1.0.1i 6 Aug 2014

#升级之后:

[root@ELK elasticsearch-head]# openssl version
OpenSSL 1.0.2k-fips 26 Jan 2017

此时再次执行,报错消除

  

4.启动logstash报错

报错如下:

Thread.exclusive is deprecated, use Thread::Mutex
Sending Logstash logs to /data/logstash/logs which is now configured via log4j2.properties
[2019-08-08T17:23:59,508][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-08-08T17:23:59,519][FATAL][logstash.runner          ] Logstash could not be started because there is already another instance using the configured data directory.  If you wish to run multiple instances, you must change the "path.data" setting.
[2019-08-08T17:23:59,527][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

  

原因:之前运行的instance有缓冲,保存在path.data里面有.lock文件,删除掉就可以

解决方法:

在 logstash.yml 文件中找到 Data path 的路径(默认在安装目录的data目录下)

# ------------ Data path ------------------
#
# Which directory should be used by logstash and its plugins
# for any persistent needs. Defaults to LOGSTASH_HOME/data
#
path.data:

  

查看是否存在 .lock 文件,如果存在把它删除

[root@ELK1 data]# ls -alh
总用量 20K
drwxr-sr-x  4 tingshuo staff 4.0K 8月 19 11:42 .
drwxr-sr-x 14 tingshuo staff 4.0K 8月 19 11:42 ..
drwxr-sr-x  2 tingshuo staff 4.0K 8月 19 11:42 dead_letter_queue
-rw-r--r--  1 tingshuo staff    0 8月 19 11:42 .lock
drwxr-sr-x  2 tingshuo staff 4.0K 8月 19 11:42 queue
-rw-r--r--  1 tingshuo staff   36 8月 19 11:42 uuid

  

删除

[root@ELK1 data]# rm .lock

  

5.Logstash 报错: A plugin had an unrecoverable error. Will restart this plugin

解决方法:

因为断开终端,进程还存在

[root@Elk1 ~]# ps aux | grep logstash
root     12180  1.6  4.5 6912300 744896 ?      Sl   Oct18  69:39 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xss2048k -Djffi.boot.library.path=/opt/logstash/vendor/jruby/lib/jni -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -Djava.awt.headless=true -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logstash/heapdump.hprof -Xbootclasspath/a:/opt/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/opt/logstash/vendor/jruby -Djruby.lib=/opt/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main --1.9 /opt/logstash/lib/bootstrap/environment.rb logstash/runner.rb agent -f /etc/logstash/conf.d/filebeat.conf
root     16921  0.0  0.0 103244   864 pts/2    S+   15:28   0:00 grep 12180
[root@Elk1 ~]# kill 12180

  

杀掉这个没有正常关闭的前台测试 Logstash 进程,重启logstash。

 

 

 

o
粉丝 0
博文 500
码字总数 0
作品 0
私信 提问
加载中
请先登录后再评论。
ElasticSearch在linux上安装部署(转)

一.安装准备工作 安装参考文档: ELK官网:https://www.elastic.co/ ELK官网文档:https://www.elastic.co/guide/index.html ELK中文手册:https://www.elastic.co/guide/cn/elasticsearch/g......

osc_f15kijhe
2019/02/18
29
0
Centos7安装Elasticsearch服务

首先ES是基于XXX的,所以需要先安装java JDK。 环境说明: 第一步:官网下载软件安装包 https://www.elastic.co/downloads/elasticsearch 第二步:选择下载了tar.gz软件包,解压缩后移动到了...

朱陈伟
2018/10/25
0
0
Centos7安装Elasticsearch服务

首先ES是基于XXX的,所以需要先安装java JDK。 环境说明: 第一步:官网下载安装包 https://www.elastic.co/downloads/elasticsearch 第二步:下载elasticsearch-6.4.2.tar.gz软件包,解压缩...

跑步回家
2018/10/25
0
0
linux-安装elasticSearch-6.6.2

环境 操作系统:ubuntu16.04 软件版本:elasticsearch-oss-6.6.2 步骤 官网 https://www.elastic.co/cn/downloads/elasticsearch-oss 下载 wget https://artifacts.elastic.co/downloads/el......

不会飞的小龙人
05/04
20
0
ElasticSearch在linux上安装部署

一.安装准备工作 安装参考文档: ELK官网:https://www.elastic.co/ ELK官网文档:https://www.elastic.co/guide/index.html ELK中文手册:https://www.elastic.co/guide/cn/elasticsearch/g......

osc_8cfq8uoa
2019/08/16
6
0

没有更多内容

加载失败,请刷新页面

加载更多

在Bash脚本中,如果发生某种情况,如何退出整个脚本?

问题: I'm writing a script in Bash to test some code. 我正在Bash中编写脚本来测试一些代码。 However, it seems silly to run the tests if compiling the code fails in the first pl......

技术盛宴
28分钟前
11
0
Windows安装Python+OpenCV

1、更新PyCharm中pip来源,使用清华和阿里云:https://pypi.tuna.tsinghua.edu.cn/simple/ http://mirrors.aliyun.com/pypi/simple/ 2、PyCharm查看已安装packets,添加新的安装包,从pip云端...

极客行
52分钟前
17
0
tomcat8配置虚拟目录,实现一个tomcat运行两个项目, tomcat配置URL不区分大小写

<?xml version="1.0" encoding="UTF-8"?><!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distri......

青峰Jun19er
58分钟前
19
0
HBase和MySQL存储方式的差别?或者说是,行存储和列存储的区别?

HBase借鉴列存储的思想,但是最底层依然是依靠键值对来存储数据,HBase为非关系型数据库 而MySQL则是行存储,MySQL为关系型数据库 写过程 行存储因为数据是连续的,所以只需要进行追加即可;...

其乐m
今天
25
0
一个老程序员在互联网寒冬下的感悟

1. 你千万不要认为学习技术就可以换来稳定的生活和高的薪水待遇,你更不要认为那些从事市场开发,跑腿的人,没有前途。 不清楚你是不是知道,咱们中国有相当大的一部分软件公司,他们的软件开...

北柠Java
今天
39
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部