skywalking 是一款不错的java apm监控服务,比zipkin功能更强大,需要的服务器配置也更多一些。
以下为skywalking通过docker快捷部署方式的docker-compose参考。
docker-compose 配置文件参考
version: '3.8'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.4.2
container_name: elasticsearch
ports:
- "9200:9200"
healthcheck:
test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./data/es_data:/usr/share/elasticsearch/data
oap:
image: apache/skywalking-oap-server:8.9.1
container_name: oap
depends_on:
elasticsearch:
condition: service_healthy
links:
- elasticsearch
ports:
- "11800:11800"
- "12800:12800"
healthcheck:
test: [ "CMD-SHELL", "/skywalking/bin/swctl ch" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
environment:
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
SW_HEALTH_CHECKER: default
SW_TELEMETRY: prometheus
JAVA_OPTS: "-Xms1024m -Xmx1024m"
ui:
image: apache/skywalking-ui:8.9.1
container_name: ui
depends_on:
oap:
condition: service_healthy
links:
- oap
ports:
- "8080:8080"
environment:
SW_OAP_ADDRESS: http://oap:12800
注意:
1.端口请勿冲突;
2.es的数据目录挂在出来最好777权限
spring boot/spring cloud 项目使用参考
java
-javaagent:D:/skywalking-agent/skywalking-agent.jar /
-Dskywalking.agent.service_name=user-provider /
-Dskywalking.collector.backend_service=101.42.137.110:11800 /
-jar yourApp.jar
注意:
service_name 请勿重复
原创文章,作者:745907710,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/243925.html