zipkin工作流程
入门application.properties
server: port: 8080spring: application: name: zipkinTest zipkin: base-url: http://localhost:9411 sender: type: web
pom.xml
logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?>
zipkin 官网地址
https://zipkin.io/pages/quickstart.html
官网的server相关的配置
https://github.com/openzipkin/zipkin/tree/master/zipkin-server
mysql的建表脚本如下
https://github.com/openzipkin/zipkin/blob/master/zipkin-storage/mysql-v1/src/main/resources/mysql.sql
使用下面的命令启动zipkin server
java -jar zipkin-server-2.23.16-exec.jar --STORAGE_TYPE=mysql --MYSQL_HOST=localhost --MYSQL_TCP_PORT=3306 --MYSQL_USER=root --MYSQL_PASS=root --MYSQL_DB=zipkinDB
rabbitmq来发送消息服务端启动命令
java -jar zipkin-server-2.23.16-exec.jar --STORAGE_TYPE=mysql --MYSQL_HOST=localhost --MYSQL_TCP_PORT=3306 --MYSQL_USER=root --MYSQL_PASS=root --MYSQL_DB=zipkinDB --RABBIT_ADDRESSES=localhost:5672 --RABBIT_USER=guest --RABBIT_PASSWORD=guest --RABBIT_VIRTUAL_HOST=/ --RABBIT_QUEUE=zipkin
修改程序的yml文件
server: port: 8080spring: application: name: zipkinTest zipkin: base-url: http://localhost:9411 sender: type: rabbit rabbitmq: queue: zipkin rabbitmq: host: 127.0.0.1 port: 5672 username: guest password: guest virtual-host: /
pom文件中添加mq的依赖
在MQ中创建消息zipkin
java -jar zipkin-server-2.23.16-exec.jar --STORAGE_TYPE=elasticsearch --ES_HOSTS=http://localhost:9200/ --RABBIT_ADDRESSES=localhost:5672 --RABBIT_USER=guest --RABBIT_PASSWORD=guest --RABBIT_VIRTUAL_HOST=/ --RABBIT_QUEUE=zipkin
会自动简历一个zipkin开头的索引