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

相关推荐
林鸿群12 分钟前
Linux Shell为文件添加BOM并自动转换为unix格式
linux·运维·unix
l and3 小时前
Jenkins 搭建鸿蒙打包
jenkins·harmonyos
Tony6666888883 小时前
【Jenkins入门以及安装】
运维·jenkins
z涛.3 小时前
Docker容器
运维·docker·容器
不做菜鸟的网工3 小时前
FreeRadius认证 WIFI-WP2-Enterprise
运维
zmjjdank1ng3 小时前
Linux 流编辑器 sed 详解
linux·运维·前端·网络·入门
鹧鸪云光伏5 小时前
[鹧鸪云]光伏AI设计平台解锁电站开发新范式
运维·服务器·人工智能·光伏·光伏设计
云和数据.ChenGuang5 小时前
Raft协议 一种专为分布式系统设计的共识算法
运维·服务器·算法·区块链·共识算法
若水晴空初如梦6 小时前
QT聊天项目DAY18
运维·服务器
long3166 小时前
使用docker compose 部署dockge
运维·docker·容器