80 lines
2.9 KiB
YAML
80 lines
2.9 KiB
YAML
# 可参考 https://github.com/apache/skywalking/blob/master/docker/docker-compose.yml
|
|
version: '3.8'
|
|
|
|
# 网桥 -> 方便相互通讯
|
|
networks:
|
|
skywalking:
|
|
ipam:
|
|
driver: default
|
|
config:
|
|
- subnet: "172.24.0.0/24"
|
|
|
|
services:
|
|
# es存储
|
|
elasticsearch:
|
|
image: registry.cn-shanghai.aliyuncs.com/odboy/elasticsearch:7.14.1 # 原镜像`elasticsearch:7.14.1`
|
|
container_name: elasticsearch # 容器名
|
|
restart: unless-stopped # 指定容器退出后的重启策略为始终重启,但是不考虑在Docker守护进程启动时就已经停止了的容器
|
|
volumes: # 数据卷挂载路径设置,将本机目录映射到容器目录
|
|
- "./elasticsearch/data:/usr/share/elasticsearch/data"
|
|
- "./elasticsearch/logs:/usr/share/elasticsearch/logs"
|
|
- "./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml"
|
|
# - "./elasticsearch/config/jvm.options:/usr/share/elasticsearch/config/jvm.options"
|
|
- "./elasticsearch/plugins/ik:/usr/share/elasticsearch/plugins/ik" # IK中文分词插件
|
|
environment: # 设置环境变量,相当于docker run命令中的-e
|
|
TZ: Asia/Shanghai
|
|
LANG: en_US.UTF-8
|
|
TAKE_FILE_OWNERSHIP: "true" # 权限
|
|
discovery.type: single-node
|
|
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
|
|
ELASTIC_PASSWORD: "elastic123456" # elastic账号密码
|
|
ports:
|
|
- "9200:9200"
|
|
- "9300:9300"
|
|
networks:
|
|
skywalking:
|
|
ipv4_address: 172.24.0.83
|
|
|
|
oap:
|
|
image: registry.cn-shanghai.aliyuncs.com/odboy/skywalking-oap-server:9.5.0 # 原镜像`apache/skywalking-oap-server:9.5.0`
|
|
container_name: oap
|
|
restart: unless-stopped
|
|
privileged: true
|
|
environment:
|
|
TZ: Asia/Shanghai
|
|
JAVA_OPTS: "-Xmx2048M -Xms2048M"
|
|
# 配置见 https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/application.yml
|
|
SW_STORAGE: elasticsearch # 指定es存储
|
|
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
|
|
SW_ES_USER: elastic
|
|
SW_ES_PASSWORD: elastic123456 # tips: 密码不能为纯数字,启动会出问题
|
|
ports:
|
|
- "11800:11800" # agent 上报数据的端口,这是 gRPC 端口
|
|
- "12800:12800" # ui 读取数据的端口, 这是 http 端口
|
|
depends_on:
|
|
- elasticsearch
|
|
links:
|
|
- elasticsearch
|
|
networks:
|
|
skywalking:
|
|
ipv4_address: 172.24.0.81
|
|
|
|
# 可视化界面
|
|
oap-ui:
|
|
image: registry.cn-shanghai.aliyuncs.com/odboy/skywalking-ui:9.5.0 # 原镜像`apache/skywalking-ui:9.5.0`
|
|
container_name: oap-ui
|
|
restart: unless-stopped
|
|
privileged: true
|
|
depends_on:
|
|
- oap
|
|
links:
|
|
- oap
|
|
ports:
|
|
- "18080:8080"
|
|
environment:
|
|
SW_OAP_ADDRESS: http://172.24.0.81:12800
|
|
TZ: Asia/Shanghai
|
|
networks:
|
|
skywalking:
|
|
ipv4_address: 172.24.0.82
|