不做介绍,直接上教程
skuwalking历史版本下载地址:https://archive.apache.org/dist/skywalking/
一.安装服务端
下载apache-skywalking-apm-8.4.0.tar.gz,丢到服务器路径下。
命令tar -zxvf 解压 ,mv ./apache-skywalking-apm-bin ./skywalking 改名
1.更改信息存储方式,默认h2(内存数据库存储方式,重启后信息丢失),我们修改成es存储。在此之前请先安装es7.x,注意版本匹配,因为7.x以下版本与7.x以上版本有区别,建议docker安装,免去配置过程。
修改目录skywalking/config下的application.yml配置文件
core:
selector: ${SW_CORE:default}
default:
# Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
# Receiver: Receive agent data, Level 1 aggregate
# Aggregator: Level 2 aggregate
role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
restHost: ${SW_CORE_REST_HOST:此处为服务器ip}
restPort: ${SW_CORE_REST_PORT:12800}
restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
restMinThreads: ${SW_CORE_REST_JETTY_MIN_THREADS:1}
restMaxThreads: ${SW_CORE_REST_JETTY_MAX_THREADS:200}
restIdleTimeOut: ${SW_CORE_REST_JETTY_IDLE_TIMEOUT:30000}
restAcceptorPriorityDelta: ${SW_CORE_REST_JETTY_DELTA:0}
restAcceptQueueSize: ${SW_CORE_REST_JETTY_QUEUE_SIZE:0}
gRPCHost: ${SW_CORE_GRPC_HOST:此处为服务器ip}
gRPCPort: ${SW_CORE_GRPC_PORT:11800}
storage:
selector: ${SW_STORAGE:elasticsearch7} #此处选择一个存储方式
elasticsearch7:
nameSpace: ${SW_NAMESPACE:""}
clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:此处为es的ip:9200}
protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""}
2.修改web配置
修改目录skywalking/webapp下的webapp.yml配置文件
server:
port: 8081 #修改端口号
collector:
path: /graphql
ribbon:
ReadTimeout: 50000
# Point to all backend's restHost:restPort, split by ,
listOfServers: 此处为服务器ip:12800
二.修改agent端配置
1.进入目录skywalking/agent目录,将optional-plugins下的apm-spring-annotation-plugin-8.4.0.jar复制到plugins目录下。
2.进入/agent/config目录
3.修改agent.config配置文件
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:此处为服务器ip:11800}
三.进入skywalking/bin目录,启动startup.sh
访问ip+端口进入web页面:
四.使用探针获取微服务数据
在启动微服务时,启动参数加:
-javaagent:/opt/skywalking/agent/skywalking-agent.jar=agent.service_name=你的微服务名
五.查看调用链