2

こんにちは私は2つのマイクロサービスを作成しました1. spotparkinと2. spotparking2そして彼らは正常にユーレカサーバに登録してからリボンクライアントを作成し、 、私は両方のmicroservicesにapplication.ymlファイルに与えているが、私はエラーの下に取得していたアプリケーション名である:リボンクライアントはユーレカに登録されたマイクロサービスを発見できません

2016年10月16日13:28:35.177エラー11304 --- [NIO-7213- exec [1] oaccC [。[/]。[dispatcherServlet]:Servlet.service() のサーブレット[ディスパッチャサーブレット]がパス[]を持つctextで投げた例外 [要求の処理に失敗しました。入れ子にされた例外は ですorg.springframework.web.client.ResourceAccessException:入出力のエラー GEの要求 "http://spotparking/spotparking/pincode": spotparking;ネストされた例外はjava.net.UnknownHostExceptionがある: spotparking]根本原因と

にjava.net.UnknownHostException:java.net.AbstractPlainSocketImpl.connect(不明なソース)で をspotparking〜[NA:1.8.0_101]

ParkingSpot parkingSpot = restTemplate.exchange("http://spotparking/spotparking/{pincode}",HttpMethod.GET,null,new ParameterizedTypeReference<ParkingSpot>() {}, pincode).getBody(); 
     return new MessageWrapper<>(parkingSpot, "server called using eureka with rest template"); 

This is how it is comming up in eureka: 

enter image description here

ソースコードhttps://github.com/focode/microservices2/

答えて

1

@LoadBalanced W上利用可能ですまた、リボン から欠落として

client: 
    serviceUrl: 
     defaultZone: http://127.0.0.1:8761/eureka/ 
    lease: 
     duration: 5 

コードが今取り組んでいる、と私のgithubのアカウントから撮影することができます追加

関連する問題