elasticsearch - centos 7服务器无法启动elasticsearch
问题描述
安装后,启动服务时出现以下错误:
[2020-11-04T07:20:12,233][WARN ][o.e.b.Natives ] [test] unable to load JNA native support library, native methods will be disabled.
java.lang.UnsatisfiedLinkError: /tmp/elasticsearch-16982199008150233397/jna17827281711253842809.tmp: /tmp/elasticsearch-16982199008150233397/jna17827281711253842809.tmp: failed to map segment from shared object: Operation not permitted
应用了以下修复:
vim /etc/sysconfig/elasticsearch
ES_TMPDIR=/var/lib/elasticsearch/tmp
vim /etc/elasticsearch/jvm.options
## JVM temporary directory
-Djava.io.tmpdir=${ES_TMPDIR}
-Djna.tmpdir=/var/lib/elasticsearch/tmp
ll /var/lib/elasticsearch
total 8
drwxr-sr-x. 3 elasticsearch elasticsearch 4096 Nov 4 07:20 nodes
drwxr-sr-x. 2 elasticsearch elasticsearch 4096 Nov 4 08:10 tmp
然后在 elasticsearch 服务启动时出现以下错误:
Nov 4 08:10:17 test systemd: Starting Elasticsearch...
Nov 4 08:10:17 test systemd-entrypoint: future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre] does not meet this requirement
Nov 4 08:10:17 test systemd-entrypoint: future versions of Elasticsearch will require Java 11; your Java version from [/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64/jre] does not meet this requirement
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # A fatal error has been detected by the Java Runtime Environment:
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # SIGSEGV (0xb) at pc=0x00007f6768e34c95, pid=194820, tid=0x00007f67d144b700
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # JRE version: OpenJDK Runtime Environment (8.0_262-b10) (build 1.8.0_262-b10)
Nov 4 08:10:19 test systemd-entrypoint: # Java VM: OpenJDK 64-Bit Server VM (25.262-b10 mixed mode, sharing linux-amd64 compressed oops)
Nov 4 08:10:19 test systemd-entrypoint: # Problematic frame:
Nov 4 08:10:19 test systemd-entrypoint: # C [jna3377815825213492039.tmp+0x12c95] ffi_prep_closure_loc+0x15
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # An error report file with more information is saved as:
Nov 4 08:10:19 test systemd-entrypoint: # /var/log/elasticsearch/hs_err_pid194820.log
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: # If you would like to submit a bug report, please visit:
Nov 4 08:10:19 test systemd-entrypoint: # http://bugreport.java.com/bugreport/crash.jsp
Nov 4 08:10:19 test systemd-entrypoint: # The crash happened outside the Java Virtual Machine in native code.
Nov 4 08:10:19 test systemd-entrypoint: # See problematic frame for where to report the bug.
Nov 4 08:10:19 test systemd-entrypoint: #
Nov 4 08:10:19 test systemd-entrypoint: 2020-11-04 13:10:19,805768 UTC [195028] ERROR CLogger.cc@310 Cannot log to named pipe /var/lib/elasticsearch/tmp/controller_log_194820 as it could not be opened for writing
Nov 4 08:10:19 test systemd-entrypoint: 2020-11-04 13:10:19,805841 UTC [195028] INFO Main.cc@103 Parent process died - ML controller exiting
环境细节:
echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-0.el7_8.x86_64
CentOS Linux release 7.7.1908 (Core)
elasticsearch-7.9.0-1.x86_64
弹性搜索.yml:
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
discovery.seed_hosts: ["IP ADDRESS HERE"]
cluster.initial_master_nodes: ["${HOSTNAME}"]
bootstrap.system_call_filter: false
任何的想法?
解决方案
看起来像错误消息中所示的权限问题,使用普通用户而不是elastic
用户进行全新安装可以正常工作。
推荐阅读
- vue.js - bootstrap-vue 模式不显示
- php - laravel - 给定可变用户输入生成组合
- smartcontracts - EOS 智能合约问题
- css - 使用填充 css 分隔 4 个边框(边框底部)并在列(th)之间留出空间
- guzzle - 检索 MailChimp 数据中心字符串时出错
- hikaricp - HikariPool-1 - 连接不可用(Camunda)
- python - 官方transformer发布的位置编码与原论文不同
- angularjs - 带有 ng-if 的 Angular ng-repeat 不适用于 tr 标签
- ruby-on-rails - 视频不是允许的类型(允许的类型:video/mp4)、Shrine、Rails
- javascript - html中行和列的总和