惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Cyberwarzone
Cyberwarzone
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
SecWiki News
SecWiki News
Martin Fowler
Martin Fowler
T
Tor Project blog
N
Netflix TechBlog - Medium
C
Cybersecurity and Infrastructure Security Agency CISA
V
Vulnerabilities – Threatpost
V
Visual Studio Blog
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
D
DataBreaches.Net
Jina AI
Jina AI
H
Heimdal Security Blog
云风的 BLOG
云风的 BLOG
P
Privacy International News Feed
A
About on SuperTechFans
J
Java Code Geeks
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News | PayPal Newsroom
有赞技术团队
有赞技术团队
MyScale Blog
MyScale Blog
博客园 - 司徒正美
C
Check Point Blog
T
Threat Research - Cisco Blogs
Attack and Defense Labs
Attack and Defense Labs
宝玉的分享
宝玉的分享
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
C
Cyber Attacks, Cyber Crime and Cyber Security
I
Intezer
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
The Last Watchdog
The Last Watchdog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
Cisco Talos Blog
Cisco Talos Blog
W
WeLiveSecurity
Hacker News: Ask HN
Hacker News: Ask HN
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
博客园 - Franky
Security Archives - TechRepublic
Security Archives - TechRepublic

博客园 - chan_炽烽

J4125 - OPNsense 配置 MGMT(管理口) J4125 - OPNsense 系统配置备份及恢复 J4125 - OPNsense 简单使用 J4125 安装 OPNsense 【VMware Workstation】Debian 13 安装 sing-box(Claaash配置转换sing-box配置) Radxa E20C 安装 飞牛 fnOS Radxa E20C 升级 LEDE(含编译过程) Radxa E20C 安装 LEDE(含编译过程) 【VMware Workstation】Debian 13 桌面版安装 安装 elasticsearch-9.1.4的 IK分词器 安装 elasticsearch-9.1.4 - 集群 和 kibana-9.1.4 Radxa E20C 安装 OpenWrt 【VMware Workstation】Rocky Linux 10 桌面版安装 iStoreOS + 旁路由 + openClash - chan_炽烽 iStoreOS + 旁路由 【推荐 - 源码安装】Redis - 安装 【推荐 - 源码安装】nginx - 安装 fastDFS - 单机部署 + nginx MySQL - 安装时的安全配置 【推荐 - glibc安装】MySQL - 安装 【推荐 - rpm安装】MySQL - 安装 修复PG.conf文件出现的问题 [七月挑选]树莓派Raspberrypi上配置Git [七月挑选]IntelliJ IDEA常用设置
docker-compose + macvlan + Elasticsearch - 9.1.4 + Kibana - 9.1.4
chan_炽烽 · 2025-09-25 · via 博客园 - chan_炽烽

操作过程

  1. 创建工作目录
mkdir -p /opt/porsCloud/24-elastic
  1. 进入工作目录
cd /opt/porsCloud/24-elastic
  1. 创建必要的目录
mkdir es_conf es_data es_logs es_plugins kibana_conf kibana_data
  1. 赋予权限
chown -R 1000:0 es_conf/ es_data/ es_logs/ es_plugins/ kibana_conf/ kibana_data/

或者

chmod -R 777 es_conf/ es_data/ es_logs/ es_plugins/ kibana_conf/ kibana_data/
  1. 添加 es_conf/elasticsearch.yml 文件
vim es_conf/elasticsearch.yml

内容如下

# 基础配置
cluster.name: "docker-cluster"
node.name: "elasticsearch-node"
network.host: 0.0.0.0
http.port: 9200
transport.port: 9300

# 发现和集群配置
discovery.type: single-node

# 禁用安全功能
xpack.security.enabled: false
xpack.security.enrollment.enabled: false

# 内存和性能配置
bootstrap.memory_lock: false

# 日志级别(可选)
logger.level: info

# 跨域配置(如果需要)
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: X-Requested-With,Content-Type,Content-Length,Authorization
  1. 添加 kibana_conf/kibana.yml 文件
vim es_conf/elasticsearch.yml

内容如下

server.host: "0.0.0.0"
server.port: 5601

i18n.locale: "zh-CN"

# Elasticsearch 连接配置(无安全认证)
elasticsearch.hosts: ["http://192.168.18.124:9200"]

# 最小化的加密密钥配置
xpack.encryptedSavedObjects.encryptionKey: "IAmSittingHereInTheBoringRoomItIsJustAnotherRainySundayAfternoon"
xpack.reporting.encryptionKey: "IAmSittingHereInTheBoringRoomItIsJustAnotherRainySundayAfternoon"
  1. 添加 docker-compose.yml 文件
vim docker-compose.yml

内容如下

services:
  elasticsearch:
    # 镜像名称
    image: elasticsearch:9.1.4
    # 容器名称
    container_name: elasticsearch
    networks:
      macvlan18:
       ipv4_address: 192.168.18.124
    # 端口映射
    ports:
      - "9200:9200"
      - "9300:9300"
    # 文件映射
    volumes:
      - /opt/porsCloud/24-elastic/es_data:/usr/share/elasticsearch/data # 数据
      - /opt/porsCloud/24-elastic/es_logs:/usr/share/elasticsearch/logs # 日志
      - /opt/porsCloud/24-elastic/es_plugins:/usr/share/elasticsearch/plugins # 插件
      - /opt/porsCloud/24-elastic/es_conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml # 配置文件
    # 环境配置
    environment:
      - "TZ=Asia/Shanghai"
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m" # 内存限制(按需配置)
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9200/"]
      interval: 30s
      timeout: 10s
      retries: 10
      start_period: 120s
  kibana:
    depends_on:
      elasticsearch:
        condition: service_healthy
    image: kibana:9.1.4
    container_name: kibana
    networks:
      macvlan18:
       ipv4_address: 192.168.18.125
    ports:
      - "5601:5601"
    volumes:
      - /opt/porsCloud/24-elastic/kibana_data:/usr/share/kibana/data
      - /opt/porsCloud/24-elastic/kibana_conf/kibana.yml:/usr/share/kibana/config/kibana.yml
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5601/status"]
      interval: 30s
      timeout: 10s
      retries: 10
      start_period: 60s
networks:
  macvlan18:
    external: true
    name: macvlan18
  1. 新增 macvlan
docker network create -d macvlan --subnet=192.168.18.0/24 --ip-range=192.168.18.0/24 --gateway=192.168.18.254 -o parent=ens18 macvlan18
  1. 启动
docker-compose up -d
  1. 访问
  • http://192.168.18.124:9200/
  • http://192.168.18.125:5601/
  1. 访问 kibana 控制台 -> Management -> 堆栈监控 ,效果如下

docker-compose-es-kibana-1