服务追踪工具 SkyWorking 搭建使用

服务追踪工具 SkyWorking 搭建使用

SkyWalking 是用于对微服务,Cloud Native,容器等提供应用性能监控和分布式调用链追踪的工具

https://hellowood.oss-cn-beijing.aliyuncs.com/blog/SkyWalkingDemo2.png

https://hellowood.oss-cn-beijing.aliyuncs.com/blog/SkyWalkingDemo3.png

https://hellowood.oss-cn-beijing.aliyuncs.com/blog/SkyWalkingDemo4.png

环境

  • SkyWalking 5.0.0-beat2
  • Mac OS
  • ElasticSearch 5.6.10

安装 ElasticSearch

  • 下载解压 ElasticSearch 5.6.10
curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.10.tar.gz
tar -vxf elasticsearch-5.6.10.tar.gz
  • 修改配置文件config/elasticsearch.yml
cluster.name: CollectorDBCluster
node.name: CollectorDBCluster1
network.host: 10.0.0.34

需要注意的是cluster.name最好是CollectorDBClusternetwork.host最好是局域网 IP,否则可能会在使用时出现很多问题

  • 启动
./bin/elasticsearch

安装 SkyWalking

  • 下载解压 SkyWalking 5.0.0-beat2
curl -L -O https://mirrors.tuna.tsinghua.edu.cn/apache/incubator/skywalking/5.0.0-beta/apache-skywalking-apm-incubating-5.0.0-beta.tar.gz

tar -vxf apache-skywalking-apm-incubating-5.0.0-beta.tar.gz
  • 修改配置文件config/application.yml,修改所有的localhost为局域网 IP
cluster
    host: 10.0.0.34
    port: 10800
    contextPath: /
cache:
  caffeine:
remote:
  gRPC:
    host: 10.0.0.34
    port: 11800
agent_gRPC:
  gRPC:
    host: 10.0.0.34
    port: 11800
agent_jetty:
  jetty:
    host: 10.0.0.34
    port: 12800
    contextPath: /
analysis_register:
  default:
analysis_jvm:
  default:
analysis_segment_parser:
  default:
    bufferFilePath: ../buffer/
    bufferOffsetMaxFileSize: 10M
    bufferSegmentMaxFileSize: 500M
    bufferFileCleanWhenRestart: true
ui:
  jetty:
    host: 10.0.0.34
    port: 12800
    contextPath: /
storage:
  elasticsearch:
    clusterName: CollectorDBCluster
    clusterTransportSniffer: true
    clusterNodes: localhost:9300
    indexShardsNumber: 2
    indexReplicasNumber: 0
    highPerformanceMode: true
    bulkActions: 2000
    bulkSize: 20
    flushInterval: 10
    concurrentRequests: 2 
    traceDataTTL: 90 # Unit is minute
    minuteMetricDataTTL: 90 # Unit is minute
    hourMetricDataTTL: 36 # Unit is hour
    dayMetricDataTTL: 45 # Unit is day
    monthMetricDataTTL: 18 # Unit is month
configuration:
  default:
    applicationApdexThreshold: 2000
    serviceErrorRateThreshold: 10.00
    serviceAverageResponseTimeThreshold: 2000
    instanceErrorRateThreshold: 10.00
    instanceAverageResponseTimeThreshold: 2000
    applicationErrorRateThreshold: 10.00
    applicationAverageResponseTimeThreshold: 2000
    thermodynamicResponseTimeStep: 50
    thermodynamicCountOfResponseTimeSteps: 40
    workerCacheMaxSize: 10000
  • 修改 webapp/webapp.yml Collector 地址
server:
  port: 8080

collector:
  path: /graphql
  ribbon:
    ReadTimeout: 10000
    listOfServers: 10.0.0.34:10800

security:
  user:
    admin:
      password: admin
  • 修改 config/agent.config Collector 地址
agent.application_code=AppService
collector.servers=10.0.0.34:10800
logging.level=INFO
  • 启动 Collector 和 Webapp
./bin/startup.sh

或单独启动 Collector 和 Webapp

./bin/collectorService.sh

./bin/webappService.sh

使用

  • Jar 启动时添加 VM 参数
-javaagent:/path/to/apache-skywalking-apm-incubating/agent/skywalking-agent.jar -Dskywalking.agent.application_code=YOUR_APP_NAME
  • Tomcat 修改bin/catalina.sh首行配置
# Linux/Mac
CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/skywalking-agent/skywalking-agent.jar"; export CATALINA_OPTS

# Win 
set "CATALINA_OPTS=-javaagent:/path/to/skywalking-agent/skywalking-agent.jar"
  • 2
    点赞
  • 0
    评论
  • 4
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

打赏
文章很值,打赏犒劳作者一下
相关推荐
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页

打赏

呜呜呜啦啦啦

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值