2016-11-17 47 views
1

有沒有其他人使用Zipkin時遇到以下問題& Spring Cloud Sleuth?似乎是將數據發佈到本地主機Zipkin服務器的問題。有沒有必要在Zipkin上配置代理設置?Spring Cloud Sleuth錯誤發佈跨度到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] 
+0

顯然,我們不能發送跨距基普金服務器。它是否在運行? :P請首先檢查您是否可以訪問它。沒有任何額外的信息,就好像Zipkin沒有運行(即拒絕連接) –

+0

您是否設法確保這是我們的問題?如果是這種情況,你可以在什麼地方發佈你的樣本? –

回答

1

請確保在您的spring啓動配置文件中正確配置您的zipkin服務器。 就像這樣:

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

並添加下面的配置在基普金客戶春季啓動配置文件:

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