DockerCompose部署SkyWalking

DockerCompose 部署 SkyWalking

配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: "3"

services:
elasticsearch:
image: elasticsearch:8.8.0
container_name: elasticsearch
ports:
- 9200:9200
- 9300:9300
volumes:
- ./data/elasticsearch:/usr/share/elasticsearch/data
environment:
- TZ=Asia/Shanghai
- xpack.security.enabled=false
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
networks:
- test-network
skywalking-oap:
image: apache/skywalking-oap-server:9.4.0-java17
container_name: skywalking-oap
restart: on-failure
ports:
- "11800:11800"
- "12800:12800"
environment:
TZ: Asia/Shanghai
SW_STORAGE: elasticsearch
SW_STORAGE_ES_CLUSTER_NODES: elasticsearch:9200
JAVA_OPTS: "-Xms2048m -Xmx2048m"
depends_on:
- elasticsearch
networks:
- test-network
skywalking-ui:
image: apache/skywalking-ui:9.4.0
container_name: skywalking-ui
restart: on-failure
ports:
- "8088:8080"
environment:
TZ: Asia/Shanghai
SW_OAP_ADDRESS: http://skywalking-oap:12800
depends_on:
- skywalking-oap
networks:
- test-network

networks:
test-network:

执行命令 docker compose -f .\docker-compose-tracing.yaml up -d
访问 http://localhost:8088

image.png

使用

  1. 下载 https://archive.apache.org/dist/skywalking/java-agent/9.0.0/apache-skywalking-java-agent-9.0.0.tgz

  2. 启动参数

1
2
3
4
-javaagent:D:\apache-skywalking-java-agent-9.0.0\skywalking-agent.jar
-Dskywalking.agent.service_name=demoService
-Dskywalking.plugin.jdbc.trace_sql_parameters=true
-Dskywalking.collector.backend_service=127.0.0.1:11800
  1. 访问接口后刷新页面

image.png