基于 Docker 搭建 Elasticsearch + Kibana 环境

server/2025/2/13 19:31:13/

一、Elasticsearch

1. 下载镜像

elasticsearch镜像不支持latest标签,必须指定版本号

% docker pull elasticsearch:8.17.2

 2. 启动容器

 参考官方文档 https://www.elastic.co/guide/en/elasticsearch/reference/7.5/docker.html

% docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:8.17.2

3. 无法启动

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGILL (0x4) at pc=0x0000ffff7413ff68, pid=26, tid=27
#
# JRE version:  (22.0.2+9) (build )
# Java VM: OpenJDK 64-Bit Server VM (22.0.2+9-70, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
# Problematic frame:
# j  java.lang.System.registerNatives()V+0 java.base@22.0.2
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid26.log
[0.013s][warning][os] Loading hsdis library failed
#
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
/usr/share/elasticsearch/bin/elasticsearch-env: line 83:    26 Aborted                 "$JAVA" "$XSHARE" -cp "$ES_CLASSPATH" org.elasticsearch.tools.java_version_checker.JavaVersionChecker

 4. 解决方法

参考 https://github.com/elastic/elasticsearch/issues/118583#issuecomment-2567270484

% docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "_JAVA_OPTIONS=-XX:UseSVE=0" elasticsearch:8.17.2

二、Kibana

1. 下载镜像

% docker pull kibana:8.17.2

2. 启动容器

% docker run -p 5601:5601 kibana:8.17.2

三、访问网页

1. 浏览器访问

        localhost:5601

2. 生成 Enrollment token

% docker exec -it container_name /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibanaPicked up _JAVA_OPTIONS: -XX:UseSVE=0
WARNING: Owner of file [/usr/share/elasticsearch/config/users] used to be [root], but now is [elasticsearch]
WARNING: Owner of file [/usr/share/elasticsearch/config/users_roles] used to be [root], but now is [elasticsearch]
eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTcyLjE3LjAuNTo5MjAwIl0sImZnciI6IjhhYTdjZDdjNDg5NjgyYzlhMjU4ZmFkNjk0MzIzYWI2ZjRiNDUwZWRjMGE1ZGM0NjAwMGViNGZhYmMyZmM4ZTkiLCJrZXkiOiItc0tlLXBRQnVwZjNRa2kxWHlwLTpfNGo3VDhvLVI2ZUhrdlJzMjBPUGhBIn0=

3. 生成密码

% docker exec -it container_name /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elasticPicked up _JAVA_OPTIONS: -XX:UseSVE=0
This tool will reset the password of the [elastic] user to an autogenerated value.
The password will be printed in the console.
Please confirm that you would like to continue [y/N]yPassword for the [elastic] user successfully reset.
New value: _4Pfdz8+3wOXaXx2ULor


http://www.ppmy.cn/server/167407.html

相关文章

Windows11+PyCharm利用MMSegmentation训练自己的数据集保姆级教程

系统版本:Windows 11 依赖环境:Anaconda3 运行软件:PyCharm 一.环境配置 通过Anaconda Prompt(anaconda)打开终端创建一个虚拟环境 conda create --name mmseg python3.93.激活虚拟环境 conda activate mmseg 4.安装pytorch和cuda tor…

PortSwigger——WebSockets vulnerabilities

文章目录 一、WebSockets二、Lab: Manipulating WebSocket messages to exploit vulnerabilities三、Lab: Manipulating the WebSocket handshake to exploit vulnerabilities四、Using cross-site WebSockets to exploit vulnerabilities4.1 跨站WebSocket劫持(cro…

C++ ——从C到C++

1、C的学习方法 (1)C知识点概念内容比较多,需要反复复习 (2)偏理论,有的内容不理解,可以先背下来,后续可能会理解更深 (3)学好编程要多练习,简…

Oracle 随机数0-100000

Oracle 随机数0-100000 在Oracle数据库中生成一个随机数(例如,0到100000之间的随机数),你可以使用DBMS_RANDOM包中的VALUE函数。DBMS_RANDOM.VALUE函数允许你指定随机数的范围。 方法1:使用DBMS_RANDOM.VALUE SELEC…

第41天:Web开发-JS应用微信小程序源码架构编译预览逆向调试嵌套资产代码审计

#知识点 1、安全开发-微信小程序-搭建&开发&架构&安全 2、安全开发-微信小程序-编译调试&反编译&泄露 一、小程序创建(了解即可) 1、下载微信开发者工具 2、创建小程序模版引用 https://developers.weixin.qq.com/miniprogram/dev/d…

MongoDB 基本操作

一、数据库操作 1. 切换或创建数据库 使用use命令切换到指定数据库,若该数据库不存在,在首次插入数据时会自动创建。 use myDatabase 2. 查看所有数据库 使用show dbs命令查看 MongoDB 实例中的所有数据库。 show dbs 3. 删除当前数据库 使用db.…

[python SQLAlchemy数据库操作入门]-25.股票数据可视化:将 SQLAlchemy 数据呈现给用户

哈喽,大家好,我是木头左! 本文将探讨如何利用SQLAlchemy从数据库中提取股票数据,并使用现代数据可视化工具将这些数据以直观的方式呈现给用户。将通过一系列步骤来演示这个过程,包括设置环境、连接数据库、提取数据、处理数据以及最终的可视化展示。 安装必要的库 接下来…

2024年12月中国电子学会青少年软件编程(Python)等级考试试卷(六级)

青少年软件编程(Python)等级考试试卷(六级) 一、单选题(共25题,共50分) 1.下面代码的输出结果正确的是?(B) import json json_str [ "Alice", "girl", 17,"New York"] data json.loa…