Skywalking使用docker-compose部署
version: '3.1'
services:
// 部署elasetic search 用于存储获取的应用信息与日志
elasticsearch:
image: elasticsearch:7.13.3
container_name: elasticsearch
privileged: true
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discovery.type=single-node" #以单一节点模式启动
- "ES_JAVA_OPTS=-Xms512m -Xmx1096m" #设置使用jvm内存大小
- bootstrap.memory_lock=true
volumes:
- ./es/plugins:/usr/local/dockercompose/elasticsearch/plugins #插件文件挂载
- ./es/data:/usr/local/dockercompose/elasticsearch/data:rw #数据文件挂载
- ./es/logs:/usr/local/dockercompose/elasticsearch/logs:rw
ports:
- 9200:9200
- 9300:9300
// skywalking 切面服务用于获取elastice中的数据
skywalking-oap-server:
image: apache/skywalking-oap-server:8.9.1
container_name: skywalking-oap-server
restart: always
ports:
- 11800:11800
- 12800:12800
environment:
SW_STORAGE: elasticsearch # 指定ES版本
SW_STORAGE_ES_CLUSTER_NODES: 你的elastic部署ip:9200
TZ: Asia/Shanghai
volumes:
- /data/oap/conf/alarm-settings.yml:/skywalking/config/alarm-settings.yml
// skywalking前端页面
skywalking-ui:
image: apache/skywalking-ui:8.9.1
container_name: skywalking-ui
restart: always
ports:
- 8080:8080
environment:
SW_OAP_ADDRESS: http://你得oap服务部署ip:12800
TZ: Asia/Shanghai
// 使用同一网络集群
networks:
default:
external:
name: nacos_default
部署完成后,可以看到三个container启动成功。
点开观察各应用中日志是否正常启动即可。