Elastic Search 整合Zipkin进行跟踪数据的持久化报错

Elastic Search 整合Zipkin进行跟踪数据的持久化报错

ZipKin\UI版本:2.12.3
Elastic Search:7.14.0

在这里插入图片描述

报错信息:`Caused by: java.lang.IllegalStateException: response for update-template failed: {“error”:{“root_cause”:[{“type”:“invalid_index_template_exception”,“reason”:“index_template [zipkin:span_template] invalid, cause [Validation Failed: 1: index_pattern [zipkin:span-] must not contain a ‘:’;]"}],“type”:“invalid_index_template_exception”,“reason”:"index_template [zipkin:span_template] invalid, cause [Validation Failed: 1: index_pattern [zipkin:span-] must not contain a ‘:’;]”},“status”:400}
at zipkin2.elasticsearch.internal.client.HttpCall.parseResponse(HttpCall.java:151) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin2.elasticsearch.internal.client.HttpCall.execute(HttpCall.java:79) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin2.elasticsearch.EnsureIndexTemplate.apply(EnsureIndexTemplate.java:40) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin2.elasticsearch.ElasticsearchStorage.ensureIndexTemplates(ElasticsearchStorage.java:301) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin2.elasticsearch.AutoValue_ElasticsearchStorage.ensureIndexTemplates(AutoValue_ElasticsearchStorage.java:28) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin2.elasticsearch.ElasticsearchStorage.spanStore(ElasticsearchStorage.java:217) ~[zipkin-storage-elasticsearch-2.8.4.jar:?]
at zipkin.storage.elasticsearch.http.ElasticsearchHttpStorage.spanStore(ElasticsearchHttpStorage.java:147) ~[zipkin-storage-elasticsearch-http-2.8.4.jar:?]
at zipkin2.server.internal.ZipkinQueryApiV2.getSpanNames(ZipkinQueryApiV2.java:97) ~[zipkin-server-2.12.3.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.1.10.RELEASE.jar:5.1.10.RELEASE]
... 86 more`
ZipKin版本注意:

release 版本是 Zipkin 2.12.9,从 2.12.6 版本开始有个较大的更新,迁移使用 Armeria HTTP 引擎。从此版本开始,若直接添加依赖的 Spring Boot 应用启动会存在冲突,降到2.12.3版本就可以正常启动

解决方案:

Elastic Search 版本过高,下载Elastic Search6.0.0可解决错误
Elastic Search6.0.0下载地址

下面是持久化步骤

我这里是下载的windows的
1.下载6.0.0版本

解压–》到bin目录–》运行elasticsearch.bat完了访问–》localhost:9200如果显示json则没问题

2.在zipkin加入依赖:
        <dependency>
            <groupId>io.zipkin.java</groupId>
            <artifactId>zipkin-autoconfigure-storage-elasticsearch-http</artifactId>
            <version>2.8.4</version>
        </dependency>
3.加配置
zipkin.storage.type=elasticsearch
zipkin.storage.elasticsearch.cluster=elasticsearch
zipkin.storage.elasticsearch.hosts=http://localhost:9200
zipkin.storage.elasticsearch.index=zipkin
4.测试,跑一下服务,关闭Zipkin服务然后重启观察链路追踪信息是否存在
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值