liunx版本的

elasticsearch:7.17.26

kibana:7.17.26

IK:7.17.26

docker-compose.yml

version: '3'

services:

elasticsearch:

image: elasticsearch:7.17.26

container_name: elasticsearch

environment:

  • discovery.type=single-node

  • ES_JAVA_OPTS=-Xms512m -Xmx512m

  • ELASTIC_PASSWORD=mplugin2025

ports:

  • "9200:9200"

  • "9300:9300"

volumes:

  • /docker/elasticsearch/data:/usr/share/elasticsearch/data

  • /docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins

  • /docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml

restart: always

network_mode: "host" # 添加此行(必须)

kibana:

image: kibana:7.17.26

container_name: kibana

ports:

  • "5601:5601"

environment:

ELASTICSEARCH_HOSTS: http://192.168.1.145:9200 # 具体ip(必须)

ELASTICSEARCH_USERNAME: elastic

ELASTICSEARCH_PASSWORD: mplugin2025

depends_on:

  • elasticsearch

restart: always

network_mode: "host" # # 添加此行(必须)

创建目录
#创建配置文件

elasticsearch.yml

cluster.name: "docker-cluster"

network.host: 0.0.0.0

启用安全特性

xpack.security.enabled: true

禁用HTTPS

xpack.security.http.ssl.enabled: false

# 下载相同版本的ik

Index of: analysis-ik/stable/https://release.infinilabs.com/analysis-ik/stable/

创建插件目录(如果不存在)

mkdir -p /docker/elasticsearch/plugins/ik

解压 ZIP 文件到插件目录

unzip /docker/elasticsearch/plugins/elasticsearch-analysis-ik-7.17.26.zip -d /docker/elasticsearch/plugins/ik

最后把压缩包删掉

# 设置适当的目录权限

chmod -R 775 /docker/elasticsearch

# 开放端口(CentOS/RHEL)

sudo firewall-cmd --permanent --add-port=9200/tcp

sudo firewall-cmd --permanent --add-port=9300/tcp

sudo firewall-cmd --permanent --add-port=5601/tcp

sudo firewall-cmd --reload

#启动

docker-compose up -d elasticsearch

docker-compose up -d kibana

相关推荐
雪可问春风1 天前
docker环境部署
运维·docker·容器
lwx9148521 天前
Linux-Shell算术运算
linux·运维·服务器
翻斗包菜1 天前
PostgreSQL 日常维护完全指南:从基础操作到高级运维
运维·数据库·postgresql
somi71 天前
ARM-驱动-02-Linux 内核开发环境搭建与编译
linux·运维·arm开发
海的透彻1 天前
nginx启动进程对文件的权限掌控
运维·chrome·nginx
路溪非溪1 天前
Linux驱动开发中的常用接口总结(一)
linux·运维·驱动开发
航Hang*1 天前
第3章:Linux系统安全管理——第2节:部署代理服务
linux·运维·服务器·开发语言·笔记·系统安全
北方的流星1 天前
华三网络设备的路由重定向配置
运维·网络·华三
河南博为智能科技有限公司1 天前
蓄电池在线监测系统-守护数据中心安全防线
运维·边缘计算
SkyWalking中文站1 天前
使用 TraceQL 查询 SkyWalking 和 Zipkin 链路追踪数据并在 Grafana 中可视化
运维·grafana·监控