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

相关推荐
末日汐17 小时前
linux线程
linux·运维
玉梅小洋17 小时前
CentOS :yum源配置及验证指南
linux·运维·centos·yum
zxsz_com_cn17 小时前
设备预测性维护算法核心功能有哪些?六大模块拆解智能运维的“技术骨架”
运维·算法
自可乐17 小时前
n8n全面学习教程:从入门到精通的自动化工作流引擎实践指南
运维·人工智能·学习·自动化
枷锁—sha17 小时前
【SRC】越权漏洞检测
运维·服务器·网络·安全·网络安全·系统安全
UP_Continue17 小时前
Linux--进程控制
linux·运维·服务器
等什么君!18 小时前
docker -数据卷技术
运维·docker·容器
小白跃升坊20 小时前
基于1Panel的AI运维
linux·运维·人工智能·ai大模型·教学·ai agent
杨江20 小时前
seafile docker安装说明
运维
好好沉淀20 小时前
Docker开发笔记(详解)
运维·docker·容器