gpt4 book ai didi

elasticsearch - Sleuth + Zipkins 与 Elasticsearch

转载 作者:行者123 更新时间:2023-12-03 00:40:15 26 4
gpt4 key购买 nike

谁能指出我需要/工作配置以将 Elasticsearch 用作带有 Sleuth 的 Zipkins 的存储类型?

pom.xml

'

<description>Spring Boot Zipkin Server</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.7.RELEASE</version>
</parent>

<properties>
<docker.image.prefix>springio</docker.image.prefix>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<sonar.skip>true</sonar.skip>
<zipkin.version>1.6.0</zipkin.version>
<elasticsearch.version>2.3.4</elasticsearch.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!-- EXAMPLE FOR RABBIT BINDING -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-rabbit</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>demo-zipkin-server</finalName>
</configuration>
</plugin>
</plugins>
</build>

`

应用程序.yml

server:
port: 9411
spring:
rabbitmq:
host: ${RABBIT_HOST:localhost}
eureka:
client:
register-with-eureka: true
service-url:
defaultZone: http://localhost:8761/eureka/
zipkin:
self-tracing:
enabled: false
storage:
type: elasticsearch
elasticsearch:
cluster: ${ES_CLUSTER:elasticsearch}
hosts: ${ES_HOSTS:localhost:9300}
index: ${ES_INDEX:zipkin}
index-shards: ${ES_INDEX_SHARDS:5}
index-replicas: ${ES_INDEX_REPLICAS:1}

应用程序不会以这些配置启动。它抛出
引起:java.lang.NoSuchMethodError: org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper.inboundMappe

最佳答案

您发布的类路径问题是特定于版本的。请更新到最新版本的依赖项。

例如,您可以从使用 start.spring.io 的基础项目开始,或者以其他方式获取最近的 deps。你也可以像这样复制一个项目:

https://github.com/openzipkin/sleuth-webmvc-example

Zipkin 目前有对 elasticsearch 的原生支持(这意味着它不使用 Elasticsearch 驱动程序)。因此,自动配置它的依赖项是:

<!-- override sleuth's zipkin version since we are using latest -->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin</artifactId>
<version>1.28.1</version>
</dependency>
<!-- add the dependency for elasticsearch via http -->
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-storage-elasticsearch-http</artifactId>
<version>1.28.1</version>
</dependency>

最少设置 zipkin.storage.type=elasticsearch。然后,设置你是 overriding注意elasticsearch的http端口是9200而不是9300

最后,请为 zipkin 中的原生 RabbitMQ 支持投票,这样你就不需要做任何这些了! https://github.com/openzipkin/zipkin/issues/1614

关于elasticsearch - Sleuth + Zipkins 与 Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44997050/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com