当前位置: 首页 > article >正文

基于 Docker 搭建 Elasticsearch + Kibana 环境

一、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 kibana

Picked 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 elastic

Picked 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]y


Password for the [elastic] user successfully reset.
New value: _4Pfdz8+3wOXaXx2ULor


http://www.kler.cn/a/543254.html

相关文章:

  • android launcher拖动图标释放错位
  • 尚硅谷爬虫note003
  • 蓝桥杯备赛笔记(二)
  • 【分布式理论9】分布式协同:分布式系统进程互斥与互斥算法
  • 服务器绑定 127.0.0.1 和 0.0.0.0 的区别
  • 京东广告生成式召回基于 NVIDIA TensorRT-LLM 的推理加速实践
  • uniapp 使用 鸿蒙开源字体
  • IntelliJ IDEA 2024.1.4版无Tomcat配置
  • 在nodejs中使用RabbitMQ(一)安装,使用
  • SPI为什么不需要加上拉电阻
  • DeepSeek-V3网络模型架构图解
  • kafka介绍,kafka集群环境搭建,kafka命令测试,C++实现kafka客户端
  • 如何选择合适的搜索关键词优化工具?
  • 按键可视化工具——Keyviz
  • 开源堡垒机 JumpServer 社区版实战教程:一步步构建企业安全运维环境
  • SQL Server:查看当前连接数和最大连接数
  • 【Vue3 入门到实战】13. 常用 API
  • 探索技术新边界:让 HTML 电子凭证与二维码、PDF 完美融合
  • 网络安全 理清 安全 边界
  • 计算机毕业设计制造业MES生产管理平台 MES 生产制造源码+文档+运行视频+讲解视频)
  • 【前端】ES6新特性汇总
  • AI直播的未来:智能化、自动化与个性化并存
  • AI时代的前端开发:效率、协作与ScriptEcho
  • C++设计模式 —— 单例模式
  • TiDB Vector 本地部署的亲身体验与心得
  • Druid GetConnectionTimeoutException解决方案之一