springboot2.0.x快速安装异步MQ监控应用zipkin

一、服务端
1、快速安装zipkin:
Docker
The Docker Zipkin project is able to build docker images, provide scripts and a docker-compose.yml for launching pre-built images. The quickest start is to run the latest image directly:

docker run -d -p 9411:9411 openzipkin/zipkin
Java
If you have Java 8 or higher installed, the quickest way to get started is to fetch the latest release as a self-contained executable jar:

curl -sSL https://zipkin.apache.org/quickstart.sh | bash -s
java -jar zipkin.jar
Running from Source
Zipkin can be run from source if you are developing new features. To achieve this, you’ll need to get Zipkin’s source and build it.

get the latest source

git clone https://github.com/apache/incubator-zipkin
cd incubator-zipkin

Build the server and also make its dependencies

./mvnw -DskipTests --also-make -pl zipkin-server clean install

Run the server

java -jar ./zipkin-server/target/zipkin-server-*exec.jar
Stop by and socialize with us on gitter, if you end up making something interesting!

   或者点击链接到官网下载自己对应版本的zipkin( https://zipkin.apache.org/pages/quickstart.html)
   可以通过docker,curl下载最新的zipkin版本
   如需要其他版本,到github下载对应源码进行编译

2、启动服务端zipkin:
指定rabbitMQ的地址
nohup java -jar zipkin-server-2.11.6-SNAPSHOT-exec.jar --zipkin.collector.rabbitmq.addresses=‘ip’ --zipkin.collector.rabbitmq.port=‘port’ --zipkin.collector.rabbitmq.username=‘username’ --zipkin.collector.rabbitmq.password=‘password’ > zipkin.log 2>&1 &

二 客户端
1.引入对应依赖:
compile(‘org.springframework.cloud:spring-cloud-starter-sleuth’)
compile(‘org.springframework.cloud:spring-cloud-starter-zipkin’)
compile(‘org.springframework.cloud:spring-cloud-stream-binder-rabbit’)
2.修改配置文件:
spring:
zipkin:
rabbitmq:
queue: zipkin
sleuth:
sampler:
percentage: 1.0 #采样率

你可能感兴趣的:(springCloud)