SkyWalking8.1.0 部署和使用

一、简介

1、官方文档

https://github.com/apache/skywalking/tree/master/docs

2、功能

SkyWalking是一个可观测性分析平台和应用性能管理系统,提供分布式跟踪、服务网格遥测分析、度量聚合和可视化一体化解决方案,并支持多种开发语言。专为微服务、云原生架构和基于容器(Docker、K8s、Mesos)架构而设计。

二、部署

1、准备

下载安装包:

http://skywalking.apache.org/downloads/

选择版本“8.1.0”->"Binary Distribution for ElasticSearch 7"->"tar"

2、安装Backend

https://github.com/apache/skywalking/blob/master/docs/en/setup/backend/backend-setup.md

2.1 修改config/application.yml配置文件:
#配置数据库
storage:
  selector: ${SW_STORAGE:elasticsearch7}  
  elasticsearch7:    
    nameSpace: ${SW_NAMESPACE:"qz-apm-release"}
    clusterNodes: {SW_STORAGE_ES_CLUSTER_NODES:192.168.0.17:9201}

#配置访问令牌
receiver-sharing-server:
  selector: ${SW_RECEIVER_SHARING_SERVER:default}  
  default:
    authentication: ${SW_AUTHENTICATION:"xxx"}
2.2 修改config/alarm-settings.ym,l配置告警:
#钉钉
dingtalkHooks:
  textTemplate: |-
    {
       "msgtype": "text",
       "text": {
         "content": "%s."
       }
    }
  webhooks:
    - url: https://oapi.dingtalk.com/robot/send?access_token=xxxxxx
      secret: xxxxxx
2.3 初始化&启动
#初始化:
./bin/oapServiceInit.sh
#启动:
./bin/oapServiceNoInit.sh
2.4 ES服务配置
1) 修改config/elasticsearch.yml
#优化线程池
#In tracing scenario, consider to set more than this at least.
thread_pool.write.queue_size: 1000
2) 优化索引
curl -X PUT -H 'Content-type':'application/json' 'http://localhost:9201/_all/_settings?preserve_existing=true' -d  '{"index.max_result_window":"1000000"}'
3) 重启ES

2.5 配置防火墙
#开启端口 
$ firewall-cmd --zone=public --add-port=11800/tcp --permanent 
$ firewall-cmd --zone=public --add-port=12800/tcp --permanent 
#重启,应用改动 
$ firewall-cmd --reload
3、安装UI
3.1 配置webapp/webapp.yml

修改端口号和Backend服务列表:

server:
  port: 8080
collector:  
  path: /graphql  
  ribbon:    
    ReadTimeout: 10000    
    # Point to all backend's restHost:restPort, split by ,    
    listOfServers: 192.168.0.161:12800
3.2 启动
$ ./bin/webappService.sh
3.3 配置防火墙
#开启端口 
$ firewall-cmd --zone=public --add-port=8080/tcp --permanent
#重启,应用改动 
$ firewall-cmd --reload
3.4 管理后台

UI地址为:http://[ip]:8080

本身不需要登录,需使用nginx做basic auth。

常见指标说明:

CPM(calls per minute):每分钟调用数。

Apdex(Application Performance Index):应用性能指数,反映真实用户体验。1为性能良好,值越小性能越差。

Successful Rate:成功率,对于http请求,为status code=200的比率。

Service Response Time Percentile(单位ms):服务响应时间百分比,分为P50、P75、P90、P95、P99。

若P75=1300ms,表示有大于百分之25(100-75)的请求,响应时间大等于1300ms。

3、安装Java Agent

https://github.com/apache/skywalking/blob/master/docs/en/setup/service-agent/java-agent/README.md

3.1 配置agent/config/agent.conf
1) 设置Token
agent.authentication = ${SW_AGENT_AUTHENTICATION:xxxx}
2) 修改Backend地址
# Backend service addresses.
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:192.168.0.161:11800}
3.2 部署到服务器
1)安装

a、可打包agent目录,复制到目标服务器

b、或者在华为云可直接使用配置好的包,执行脚本

$ cd /opt && curl -k -O http://192.168.0.190:9000/apache-skywalking-8.1.0-agent.tar.gz && tar -zxvf apache-skywalking-8.1.0-agent.tar.gz && rm -rf apache-skywalking-8.1.0-agent.tar.gz
2)配置tomcat

a、配置代理 tomcat/bin/catalina.sh的第一行,增加

CATALINA_OPTS="$CATALINA_OPTS -javaagent:/opt/apache-skywalking-8.1.0-agent/skywalking-agent.jar=agent.namespace=qz_release,agent.service_name=qz-jserver-portal,agent.instance_name=qz-jserver-portal-rel1";export CATALINA_OPTS

其中:

agent.namespace:分隔不同项目或者环境

agent.service_name:服务名称

agent.instance_name:服务实例名称

b、重启。

4、配置.NET Agent

https://github.com/SkyAPM/SkyAPM-dotnet

三、扩展:

OpenTracing官方标准:

https://github.com/opentracing-contrib/opentracing-specification-zh

Skywalking中文文档(旧):

https://github.com/SkyAPM/document-cn-translation-of-skywalking

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值