Fork me on GitHub

Spring Cloud 微服务分布式链路跟踪 Sleuth 与 Zipkin

Zipkin 是一个开放源代码分布式的跟踪系统,由 Twitter 公司开源,它致力于收集服务的定时数据,以解决微服务架构中的延迟问题,包括数据的收集、存储、查找和展现。它的理论模型来自于 Google Dapper 论文。 每个微服务向 Zipkin 报告计时数据,Zipkin 会根据调用关系通过 Zipkin UI 生成依赖关系图,显示了多少跟踪请求通过每个服务,该系统让开发者可通过一个 Web 前端轻松的收集和分析数据,例如用户每次请求服务的处理时间等,可方便的监测系统中存在的瓶颈。

GitHub 上相关的开源项目
https://github.com/openzipkin/zipkin
https://github.com/apache/incubator-skywalking
https://github.com/naver/pinpoint
https://github.com/jaegertracing/jaeger
https://github.com/opentracing
https://github.com/dianping/cat
https://github.com/hawkular/hawkular-apm
https://github.com/getsentry/sentry
https://github.com/alipay/sofa-tracer

Zipkin 服务端

关于 Zipkin 的服务端,在使用 Spring Boot 2.x 版本后,官方就不推荐自行定制编译了,可以直接使用编译好的 jar 包,详情:https://github.com/openzipkin/zipkin/issues/1962 ,并且以前的@EnableZipkinServer 也已经被打上了@Deprecated 状态,测试环境可以通过官方的脚本或 Docker 来快速运行。

使用脚本

curl -sSL https://zipkin.io/quickstart.sh | bash -s
java -jar zipkin.jar

使用 Docker

sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
#yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce
sudo systemctl enable docker && systemctl start docker
sudo systemctl status docker
sudo systemctl daemon-reload
sudo systemctl restart docker
docker run -d -p 9411:9411 openzipkin/zipkin

posted @ 2018-08-13 10:54  花儿笑弯了腰  阅读(474)  评论(0编辑  收藏  举报