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

相关推荐
IT小哥哥呀2 小时前
Nginx高可用配置实战:负载均衡 + 健康检查 + 动态扩展
运维·nginx·负载均衡·devops·日志分析·openresty·动态扩展
刘某的Cloud2 小时前
ceph osd down排查
linux·运维·ceph·系统·osd
喜欢你,还有大家6 小时前
Docker-仓库-镜像制作
运维·docker·容器
安审若无7 小时前
图数据库neoj4安装部署使用
linux·运维·数据库
做运维的阿瑞7 小时前
CentOS DNS故障排查完整解决方案:从症状到根因的系统化诊断
linux·运维·centos
深圳市恒讯科技8 小时前
英国服务器Windows系统远程桌面安装与优化
运维·服务器·windows
itachi-uchiha8 小时前
head和tail命令使用
linux·运维·服务器
violet-lz8 小时前
Socket编程实战:从基础API到多线程服务器
运维·服务器
初学者_xuan9 小时前
零基础新手小白快速了解掌握服务集群与自动化运维(十六)集群部署模块——LVS-DR&TUN模式配置
运维·自动化·lvs
测试老哥9 小时前
Jmeter+Maven+jenkins+eclipse 搭建自动化测试平台
自动化测试·软件测试·测试工具·jmeter·jenkins·maven·性能测试