BlueXIII's Blog

热爱技术,持续学习

0%

Skywalking学习笔记

参考文档

下载地址

https://skywalking.apache.org/downloads/

OAP地址

OAP:
http://10.193.2.8:12800
10.193.2.8:11800

UI:
http://10.193.2.8:18080

Agent配置

1
2
3
4
5
export SW_AGENT_NAME=dubhe-quality
export SW_AGENT_COLLECTOR_BACKEND_SERVICES=10.193.2.8:11800
export SW_AGENT_SPAN_LIMIT=2000
export JAVA_AGENT=-javaagent:/path/to/skywalking-agent.jar
java -jar $JAVA_AGENT -jar dubhe-quality-biz.jar

DevOps配置

Dockerfile

1
2
3
4
5
6
7
8
9
10
FROM openjdk:17-oracle
MAINTAINER la
ENV TZ=Asia/Shanghai
RUN ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p /dubhe-quality-biz
WORKDIR /dubhe-quality-biz
EXPOSE 8604
ADD ./dubhe-quality/dubhe-quality-biz/target/dubhe-quality-biz.jar ./
ADD ./deploy/skyskywalking-agent.tar.gz /
CMD java --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED -Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom -jar -javaagent:/skywalking-agent/skywalking-agent.jar -jar dubhe-quality-biz.jar

K8S Yaml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- env:
- name: NACOS_HOST
value: 10.133.0.63
- name: NACOS_PORT
value: 30501
- name: SERVICE_HOST
value: 10.133.0.63
- name: SERVICE_PORT
value: 30510
- name: NACOS_USERNAME
value: nacos
- name: NACOS_PASSWORD
value: nacos
- name: SW_AGENT_NAME
value: dubhe-quality
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
value: 10.193.2.8:11800
- name: SW_AGENT_SPAN_LIMIT
value: 2000

本机打包测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
docker build -f dubhe-quality/dubhe-quality-biz/Dockerfile -t dubhe-quality .

docker run --rm \
--name dubhe-quality \
-p 8604:8604 \
-e NACOS_HOST=10.133.0.63 \
-e NACOS_PORT=30501 \
-e SERVICE_HOST=10.255.2.133 \
-e SERVICE_PORT=8604 \
-e NACOS_USERNAME=nacos \
-e NACOS_PASSWORD=nacos \
-e SW_AGENT_NAME=dubhe-quality \
-e SW_AGENT_COLLECTOR_BACKEND_SERVICES=10.193.2.8:11800 \
-e SW_AGENT_SPAN_LIMIT=2000 \
dubhe-quality:latest