gpt4 book ai didi

java - Spring Cloud Sleuth 错误发布跨越到 Zipkin

转载 作者:行者123 更新时间:2023-11-30 02:44:22 28 4
gpt4 key购买 nike

还有其他人在使用 Zipkin 和 Spring Cloud Sleuth 时遇到过以下问题吗?将数据发布到我的本地主机 Zipkin 服务器似乎存在问题。 Zipkin 是否需要配置代理设置?

2016-11-17 12:13:59.270 DEBUG [myService,,,] 16588 --- [pool-1-thread-1] o.s.c.s.zipkin.HttpZipkinSpanReporter    : error POSTing spans to http://localhost:9411/api/v1/spans: as json {span data}

java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_112]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_112]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_112]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_112]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_112]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_112]
at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_112]
at sun.net.NetworkClient.doConnect(NetworkClient.java:180) ~[na:1.8.0_112]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[na:1.8.0_112]
at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[na:1.8.0_112]
at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) ~[na:1.8.0_112]
at sun.net.www.http.HttpClient.New(HttpClient.java:308) ~[na:1.8.0_112]
at sun.net.www.http.HttpClient.New(HttpClient.java:326) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) ~[na:1.8.0_112]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) ~[na:1.8.0_112]
at org.springframework.cloud.sleuth.zipkin.HttpZipkinSpanReporter.postSpans(HttpZipkinSpanReporter.java:146) ~[spring-cloud-sleuth-zipkin-1.0.0.RELEASE.jar:1.0.0.RELEASE]
at org.springframework.cloud.sleuth.zipkin.HttpZipkinSpanReporter.flush(HttpZipkinSpanReporter.java:96) ~[spring-cloud-sleuth-zipkin-1.0.0.RELEASE.jar:1.0.0.RELEASE]
at org.springframework.cloud.sleuth.zipkin.HttpZipkinSpanReporter$Flusher.run(HttpZipkinSpanReporter.java:124) [spring-cloud-sleuth-zipkin-1.0.0.RELEASE.jar:1.0.0.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_112]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_112]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_112]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112]

最佳答案

请确保在 Spring Boot 配置文件中正确配置 zipkin 服务器。就像这样:

    logging:
level.org.springframework.cloud: DEBUG
spring:
application:
name: service-tracking
sleuth:
enabled: false
zipkin:
storage:
type: mem
server:
port: 9411

并在 zipkin 客户端 spring boot 配置文件中添加以下配置:

  sleuth:
enabled: true
sampler:
percentage: 1
zipkin:
enabled: true
baseUrl: http://${tracking-host:tracking}:9411

关于java - Spring Cloud Sleuth 错误发布跨越到 Zipkin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40654863/

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