7

Spring Cloud之Finchley版学习(二十六)-使用Elasticsearch作为Zipkin Server的后端...

 3 years ago
source link: https://www.wencst.com/archives/1673
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Spring Cloud之Finchley版学习(二十六)-使用Elasticsearch作为Zipkin Server的后端存储

作者: wencst 分类: JAVA,微服务,架构设计 发布时间: 2019-03-29 15:58 阅读: 2,124 次

前文搭建的Zipkin Server是没有后端存储的——数据会存储在Zipkin的内存中。这一般不适合生产,本节来探讨如何将Zipkin中的数据持久化。

Zipkin支持多种存储:

  • 内存(默认)
  • MySQL(数据量大时,查询较为缓慢,不建议使用)
  • Elasticsearch
  • Cassandra(Twitter官方使用Cassandra作为Zipkin Server的存储,但国内大规模用Cassandra的公司较少,Cassandra相关文档也不多)

综上,个人建议使用Elasticsearch作为Zipkin Server的存储。

OK,话不多说,来搭建吧。

  • 前往 https://www.elastic.co/products/elasticsearch 下载Elasticsearch,笔者使用的版本是 elasticsearch-6.5.3
  • 启动Elasticsearch:
cd elasticsearch-6.5.3/bin
./elasticsearch

# Elasticsearch集群的搭建大家自己百度一下吧,也很简单。本文主要是讲Zipkin,只用一个实例演示就可以了。

执行如下命令,启动Zipkin Server

STORAGE_TYPE=elasticsearch ES_HOSTS=localhost:9200 java -jar zipkin-server-2.11.3-exec.jar

测试步骤非常简单:

如果文章对您有用,扫一下支付宝的红包,不胜感激!

欢迎加入QQ群进行技术交流:656897351(各种技术、招聘、兼职、培训欢迎加入)

Leave a Reply Cancel reply

You must be logged in to post a comment.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK