SpringCloud版本:Dalston.SR1, rabbitMQ版本:3.6.10,ElasticSearch版本:6.2.4
当我使用MySQL作为存储时,没有什么不寻常的 现在我使用ElasticSearch。我找不到任何服务 我丢了东西?
这是图片:
application.properties
server.port=11008
spring.application.name=microservice-zipkin-stream-server-es
spring.sleuth.enabled=false
spring.sleuth.sampler.percentage=1.0
zipkin.storage.StorageComponent = elasticsearch
zipkin.storage.type=elasticsearch
zipkin.storage.elasticsearch.cluster=elasticsearch-zipkin-cluster
zipkin.storage.elasticsearch.hosts=127.0.0.1:9300
zipkin.storage.elasticsearch.max-requests=64
zipkin.storage.elasticsearch.index=zipkin
zipkin.storage.elasticsearch.index-shards=5
zipkin.storage.elasticsearch.index-replicas=1
spring.rabbitmq.host=192.168.0.162
spring.rabbitmq.port=5672
spring.rabbitmq.username=basefrm
spring.rabbitmq.password=basefrm
eureka.instance.hostname=192.168.0.162
eureka.client.serviceUrl.defaultZone=http://192.168.0.162:8761/eureka/
management.security.enabled=false
的pom.xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin</artifactId>
<version>2.4.1</version>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-storage-elasticsearch-http</artifactId>
<version>2.4.1</version>
<optional>true</optional>
</dependency>
答案 0 :(得分:1)
您正在使用古老版本的侦探,请升级吗?为什么要手动提供Zipkin的版本?另外,据我所知,您使用的是Sleuth的Zipkin服务器(在Edgware中已弃用并在Finchley中删除)。我的建议是你停止使用Sleuth的Stream服务器(你可以在这里阅读更多相关信息https://cloud.spring.io/spring-cloud-static/Edgware.SR3/single/spring-cloud.html#_sleuth_with_zipkin_via_rabbitmq_or_kafka)。
<dependencyManagement> (1)
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${release.train.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency> (2)
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
</dependency>
<dependency> (3)
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>
1)为了不自行选择版本,如果通过Spring BOM添加依赖关系管理会更好
2)将依赖项添加到spring-cloud-starter-zipkin - 这样就可以下载所有依赖的依赖项
3)要自动配置兔子,只需添加spring-rabbit依赖