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

相关推荐
计算机安禾3 分钟前
【Linux从入门到精通】第31篇:防火墙漫谈——iptables与firewalld防护指南
linux·运维·php
下一页盛夏花开20 分钟前
ubuntu 20中安装QT以后出现红色空心断点
linux·运维·ubuntu
sxgzzn3 小时前
光伏数智化综合平台:让光伏电站运维更智能、更高效
运维
乌托邦的逃亡者4 小时前
Linux中如何检测IP冲突
linux·运维·tcp/ip
一曦的后花园5 小时前
linux搭建promethes并对接node-exporter指标
linux·运维·服务器
乌托邦的逃亡者5 小时前
CentOS/Openeuler主机中,为一个网卡设置多个IP地址
linux·运维·网络·tcp/ip·centos
拾贰_C6 小时前
【OpenClaw | openai | QQ】 配置QQ qot机器人
运维·人工智能·ubuntu·面试·prompt
桌面运维家6 小时前
服务器进程异常监控:快速定位与排障实战指南
运维·服务器
风曦Kisaki6 小时前
# Linux Shell 编程入门 Day02:条件测试、if 判断、循环与随机数
linux·运维·chrome