Elasticsearch不删原有jdk8导致的系列安装和启动问题

以前在空机器直接装elasticsearch,没有遇到什么问题。今天在现有JDK上安装,遇到的问题记录一下:

1. JDK的环境变量配置与我原有的不一致报如下错误: 

[estest@ZK-DES-I root]$ /usr/elasticsearch/bin/elasticsearch
could not find java in JAVA_HOME or bundled at /usr/java/jdk1.8.0_102//bin/java

root用户下的是:

而estest用户下是:

解决方式:修改estest用户下的java_home:

[estest@ZK-DES-I root]$ export JAVA_HOME=/usr/java/jdk1.8.0_241-amd64
[estest@ZK-DES-I root]$ echo $JAVA_HOME
/usr/java/jdk1.8.0_241-amd64

 2. JDK版本匹配问题,报如下错误:

[estest@ZK-DES-I root]$ /usr/elasticsearch/bin/elasticsearch
future versions of Elasticsearch will require Java 11; your Java version from [/usr/java/jdk1.8.0_241-amd64/jre] does not meet this requirement
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to Permission denied

Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /usr/elasticsearch/config/elasticsearch.keystore
Likely root cause: java.nio.file.AccessDeniedException: /usr/elasticsearch/config/elasticsearch.keystore
    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 org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:77)
    at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:218)
    at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:234)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:305)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
    at org.elasticsearch.cli.Command.main(Command.java:90)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Refer to the log for complete error details.
 

 解决方式:

屏蔽vi /usr/elasticsearch/bin/elasticsearch-env部分代码,使用自带的JDK;

 3. jvm内存模型问题,9删掉UseConcMarkSweepGCre这个jvm参数,所以需要修改对应的参数。

并且,还存在文件的权限问题。

[estest@ZK-DES-I root]$ /usr/elasticsearch/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.
Exception in thread "main" org.elasticsearch.bootstrap.BootstrapException: java.nio.file.AccessDeniedException: /usr/elasticsearch/config/elasticsearch.keystore
Likely root cause: java.nio.file.AccessDeniedException: /usr/elasticsearch/config/elasticsearch.keystore
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:219)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:373)
    at java.base/java.nio.file.Files.newByteChannel(Files.java:424)
    at org.apache.lucene.store.SimpleFSDirectory.openInput(SimpleFSDirectory.java:77)
    at org.elasticsearch.common.settings.KeyStoreWrapper.load(KeyStoreWrapper.java:218)
    at org.elasticsearch.bootstrap.Bootstrap.loadSecureSettings(Bootstrap.java:234)
    at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:305)
    at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159)
    at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
    at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
    at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124)
    at org.elasticsearch.cli.Command.main(Command.java:90)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
    at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Refer to the log for complete error details.
 

 解决方式:

(1)修改GC:/usr/elasticsearch/config/jvm.options

(2)文件的权限问题:删除该文件,下次启动es时会自动创建。

rm -rf elasticsearch.keystore

结束:

[estest@ZK-DES-I config]$ /usr/elasticsearch/bin/elasticsearch
[2024-05-21T11:46:15,369][INFO ][o.e.e.NodeEnvironment    ] [node-1] using [1] data paths, mounts [[/ (/dev/mapper/zkos-root)]], net usable_space [193gb], net total_space [216gb], types [xfs]
[2024-05-21T11:46:15,374][INFO ][o.e.e.NodeEnvironment    ] [node-1] heap size [1gb], compressed ordinary object pointers [true]
[2024-05-21T11:46:15,377][INFO ][o.e.n.Node               ] [node-1] node name [node-1], node ID [Cep1Bsm0QQi_4UqlWY5gow], cluster name [elasticsearch]
[2024-05-21T11:46:15,379][INFO ][o.e.n.Node               ] [node-1] version[7.3.0], pid[10736], build[default/tar/de777fa/2019-07-24T18:30:11.767338Z], OS[Linux/3.10.0-1160.31.1.el7.x86_64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/12.0.1/12.0.1+12]
[2024-05-21T11:46:15,380][INFO ][o.e.n.Node               ] [node-1] JVM home [/usr/elasticsearch/jdk]
[2024-05-21T11:46:15,381][INFO ][o.e.n.Node               ] [node-1] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseG1GC, -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-5306095514978348496, -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/elasticsearch, -Des.path.conf=/usr/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar, -Des.bundled_jdk=true]
[2024-05-21T11:46:16,981][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [aggs-matrix-stats]
[2024-05-21T11:46:16,981][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [analysis-common]
[2024-05-21T11:46:16,981][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [data-frame]
[2024-05-21T11:46:16,982][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [flattened]
[2024-05-21T11:46:16,982][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-common]
[2024-05-21T11:46:16,982][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-geoip]
[2024-05-21T11:46:16,983][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [ingest-user-agent]
[2024-05-21T11:46:16,983][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-expression]
[2024-05-21T11:46:16,983][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-mustache]
[2024-05-21T11:46:16,983][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [lang-painless]
[2024-05-21T11:46:16,984][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [mapper-extras]
[2024-05-21T11:46:16,984][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [parent-join]
[2024-05-21T11:46:16,984][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [percolator]
[2024-05-21T11:46:16,985][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [rank-eval]
[2024-05-21T11:46:16,985][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [reindex]
[2024-05-21T11:46:16,985][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [repository-url]
[2024-05-21T11:46:16,985][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [transport-netty4]
[2024-05-21T11:46:16,986][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [vectors]
[2024-05-21T11:46:16,986][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ccr]
[2024-05-21T11:46:16,986][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-core]
[2024-05-21T11:46:16,987][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-deprecation]
[2024-05-21T11:46:16,987][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-graph]
[2024-05-21T11:46:16,987][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ilm]
[2024-05-21T11:46:16,988][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-logstash]
[2024-05-21T11:46:16,988][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-ml]
[2024-05-21T11:46:16,988][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-monitoring]
[2024-05-21T11:46:16,989][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-rollup]
[2024-05-21T11:46:16,989][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-security]
[2024-05-21T11:46:16,989][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-sql]
[2024-05-21T11:46:16,989][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-voting-only-node]
[2024-05-21T11:46:16,990][INFO ][o.e.p.PluginsService     ] [node-1] loaded module [x-pack-watcher]
[2024-05-21T11:46:16,990][INFO ][o.e.p.PluginsService     ] [node-1] no plugins loaded
[2024-05-21T11:46:20,434][INFO ][o.e.x.s.a.s.FileRolesStore] [node-1] parsed [0] roles from file [/usr/elasticsearch/config/roles.yml]
[2024-05-21T11:46:20,982][INFO ][o.e.x.m.p.l.CppLogMessageHandler] [node-1] [controller/10843] [Main.cc@110] controller (64 bit): Version 7.3.0 (Build ff2f774f78ce63) Copyright (c) 2019 Elasticsearch BV
[2024-05-21T11:46:21,349][DEBUG][o.e.a.ActionModule       ] [node-1] Using REST wrapper from plugin org.elasticsearch.xpack.security.Security
[2024-05-21T11:46:21,671][INFO ][o.e.d.DiscoveryModule    ] [node-1] using discovery type [zen] and seed hosts providers [settings]
[2024-05-21T11:46:22,410][INFO ][o.e.n.Node               ] [node-1] initialized
[2024-05-21T11:46:22,411][INFO ][o.e.n.Node               ] [node-1] starting ...
[2024-05-21T11:46:22,522][INFO ][o.e.t.TransportService   ] [node-1] publish_address {192.168.0.146:9300}, bound_addresses {192.168.0.146:9300}
[2024-05-21T11:46:22,528][INFO ][o.e.b.BootstrapChecks    ] [node-1] bound or publishing to a non-loopback address, enforcing bootstrap checks
[2024-05-21T11:46:22,546][INFO ][o.e.c.c.Coordinator      ] [node-1] cluster UUID [Z2yUq7JMRumorsrrAxll7g]
[2024-05-21T11:46:22,673][INFO ][o.e.c.s.MasterService    ] [node-1] elected-as-master ([1] nodes joined)[{node-1}{Cep1Bsm0QQi_4UqlWY5gow}{9EWeByLlROKIeCa4z-KSUQ}{192.168.0.146}{192.168.0.146:9300}{dim}{ml.machine_memory=8124235776, xpack.installed=true, ml.max_open_jobs=20} elect leader, _BECOME_MASTER_TASK_, _FINISH_ELECTION_], term: 3, version: 19, reason: master node changed {previous [], current [{node-1}{Cep1Bsm0QQi_4UqlWY5gow}{9EWeByLlROKIeCa4z-KSUQ}{192.168.0.146}{192.168.0.146:9300}{dim}{ml.machine_memory=8124235776, xpack.installed=true, ml.max_open_jobs=20}]}
[2024-05-21T11:46:22,731][INFO ][o.e.c.s.ClusterApplierService] [node-1] master node changed {previous [], current [{node-1}{Cep1Bsm0QQi_4UqlWY5gow}{9EWeByLlROKIeCa4z-KSUQ}{192.168.0.146}{192.168.0.146:9300}{dim}{ml.machine_memory=8124235776, xpack.installed=true, ml.max_open_jobs=20}]}, term: 3, version: 19, reason: Publication{term=3, version=19}
[2024-05-21T11:46:22,790][INFO ][o.e.h.AbstractHttpServerTransport] [node-1] publish_address {192.168.0.146:9200}, bound_addresses {192.168.0.146:9200}
[2024-05-21T11:46:22,791][INFO ][o.e.n.Node               ] [node-1] started
[2024-05-21T11:46:22,957][INFO ][o.e.l.LicenseService     ] [node-1] license [726fb8e9-c347-4ab8-9a07-e130870d53b7] mode [basic] - valid
[2024-05-21T11:46:22,958][INFO ][o.e.x.s.s.SecurityStatusChangeListener] [node-1] Active license is now [BASIC]; Security is disabled
[2024-05-21T11:46:22,967][INFO ][o.e.g.GatewayService     ] [node-1] recovered [0] indices into cluster_state

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/14978.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python-数据分析与可视化基础

1、data1.csv中的B、C、D和E列数据分别是日期、权重、A企业的销售额、B企业的销售额。读取C、D、E列数据,并统计E列数据的算术平均数、加权平均值(权值为C列数据)、方差、中位数、最小值、最大值。并绘制E列数据的直方图。 (1)源代码: impo…

什么生信流程语言让你极度爽?

生信流程搭建有多难?行业为解决这一问题提出了各种各样的配方,有你熟悉的吗? 一、困境 - 乱 无数机构投入大量人力物力,以期获得一条条可用的生信流程。而有些流程,由于种种原因,存在着巨大的缺陷&#xf…

安全风险 - 切换后台时背景模糊处理

因为安全风险中提到当app处于后台卡片状态时,显示的卡片页面应该为模糊效果,否则容易泄露用户隐私,尤其当前页涉及个人信息、资产信息等,都会造成信息泄露!基于这种场景,我研究了下这种业务下的模糊效果 找…

普通函数的参数中的auto

2.1 普通函数的参数中的auto 从c14起&#xff0c;lambda可以使用auto占位符声明或者定义参数: auto printColl [] (const auto& coll) // generic lambda{ for (const auto& elem : coll) {std::cout << elem << \n;}} 只要支持Lambda 内部的操作&…

Golang创建文件夹

方法 package zdpgo_fileimport ("os" )// AddDir 创建文件夹 func AddDir(dir string) error {if !IsExist(dir) {return os.MkdirAll(dir, os.ModePerm)}return nil }测试 package zdpgo_fileimport "testing"func TestAddDir(t *testing.T) {data : […

JAVA云HIS医院系统源码 HIS源码:云HIS系统与SaaS的关系

云HIS系统与SaaS的关系 云HIS系统是一种基于云计算技术的医院信息系统&#xff0c;它采用B/S架构&#xff0c;通过云端SaaS服务的方式提供。用户可以通过浏览器访问云HIS系统&#xff0c;无需关注系统的部署、维护、升级等问题。云HIS系统通常具有模板化、配置化、智能化等特点…

hot100 -- 回溯(上)

目录 &#x1f35e;科普 &#x1f33c;全排列 AC DFS &#x1f6a9;子集 AC DFS &#x1f382;电话号码的字母组合 AC DFS &#x1f33c;组合总和 AC DFS &#x1f35e;科普 忘记 dfs 的&#xff0c;先看看这个&#x1f447; DFS&#xff08;深度优先搜索&#xf…

百度软件测试面试经历,期望薪资27K

一面 1、 请为百度搜索框设计测试用例&#xff1f; 2、百度设计框上线前需要进行那些测试&#xff1f; 界面测试&#xff0c;功能测试&#xff0c;性能测试&#xff0c;安全性测试&#xff0c;易用性测试&#xff0c;兼容性测试&#xff0c;UI测试。 3、如何查看http状态码…

重学java 38.创建线程的方式⭐

It is during our darkest moments that we must focus to see the light —— 24.5.24 一、第一种方式_继承extends Thread方法 1.定义一个类,继承Thread 2.重写run方法,在run方法中设置线程任务(所谓的线程任务指的是此线程要干的具体的事儿,具体执行的代码) 3.创建自定义线程…

基于灰狼优化算法优化支持向量机(GWO-SVM)回归预测

代码原理 基于灰狼优化算法优化支持向量机&#xff08;GWO-SVM&#xff09;的回归预测代码的原理和流程如下&#xff1a; 1. **初始化灰狼群体**&#xff1a;随机生成一定数量的灰狼&#xff0c;并初始化它们的位置和速度。 2. **初始化SVM模型参数**&#xff1a;根据问题要…

【JAVA基础之网络编程】UDP和TCP协议以及三次握手和四次挥手的过程

&#x1f525;作者主页&#xff1a;小林同学的学习笔录 &#x1f525;mysql专栏&#xff1a;小林同学的专栏 目录 1. 网络编程 1.1 概述 1.2 网络编程的三要素 1.2.1 IP地址 1.2.2 InetAddress 1.2.3 端口和协议 1.3 UDP协议 1.3.1 UDP发送数据 1.3.2 UDP接收数据 1.4…

C语言——小知识和小细节18

一、力扣题目 1、题目本体 2、题解 本题目我们使用异或分组的方法来解决。可以在我之前的文章《C语言——操作符CSDN博客》中看一下异或的特点。 由于异或的运算规则为相同为0&#xff0c;不同为1&#xff0c;而且是在二进制补码上进行操作的&#xff0c;我们可以发现的一个…

c++|多态

c|多态 1 多态的概念2 多态的定义及其实现2.1 满足多态的条件2.2 虚函数2.3 虚函数的重写2.4 析构函数适合加virtural吗2.4 C11 override 和 final2.5 三个概念的对比 3 多态的原理4 抽象类4.1 概念4.2 纯虚函数 1 多态的概念 多态的概念&#xff1a;通俗来说&#xff0c;就是…

【再探】设计模式—代理模式

代理是指授权代理人在一定范围内代表其向第三方进行处理有关事务。 1 代理模式 需求&#xff1a;1&#xff09;将业务代码与非业务代码分离&#xff0c;在不改变代码结构的基础上&#xff0c;为其添加新的功能。2&#xff09;为系统中的某些操作做同一处理&#xff0c;例如进…

[实例] Unity Shader 逐像素漫反射与半兰伯特光照

漫反射光照是Unity中最基本最简单的光照模型&#xff0c;本篇将会介绍在片元着色器中实现反射效果&#xff0c;并会采用半兰伯特光照技术对其进行改进。 1. 逐顶点光照与逐像素光照 在Unity Shader中&#xff0c;我们可以有两个地方可以用来计算光照&#xff1a;在顶点着色器…

z3-加法器实验

补码器加减法&#xff0c;运算方法简介 我们要知道什么是补码的加法&#xff0c;我们为什么要用补码的加法&#xff1f; 补码的加法其实就是将两个补码形式的二进制数字直接相加&#xff0c;处理的时候忽略超出固定位数的进位。补码的加法运算和无符号二进制数的加法操作一样&…

【最新区块链论文录用资讯】CCF A — SP 2024 共17篇

Conference&#xff1a;45th IEEE Symposium onSecurity and Privacy CCF level&#xff1a;CCF A Categories&#xff1a;网络与信息安全 Year&#xff1a;2024 Num&#xff1a;17 Efficient Zero-Knowledge Arguments For Paillier Cryptosystem Paillier 加密系统的有效…

基于python的网页自动刷新工具

1.下载webdriver https://msedgewebdriverstorage.z22.web.core.windows.net/?prefix122.0.2365.59/下载Edge的浏览器驱动 2.安装selenium pip install selenium4.11.1 3.写代码 # -*- coding: utf-8 -*- import tkinter as tk from tkinter import messagebox import thr…

【halcon】set_part 实现平移和缩放 彻悟版

背景 之前写了一篇关于set_part 的文章 &#xff0c;确实也实现了平移和缩放。平移是对的&#xff0c;但是缩放其实有畸变。这个问题一直都困扰着我&#xff0c;知道昨天连续测试了好几个小时&#xff0c;直到晚上11点终于完美解决。 坐标和高宽 坐标 再讲set_part 之前&am…

免费撸gpt-4o和各种大模型实用经验分享

项目 Github: https://github.com/MartialBE/one-api 先贴两张图&#xff1a; 说明 免费撸AI大模型,各位可以对照下面我给出的大模型记录表来填&#xff0c;key需要自己去拿&#xff0c;国内都需要手机号验证&#xff0c;如果你不介意。另外我在自己的博客放出免费API给大家…