2017-06-07 5 views
0

こんにちは、私は、複数のサーバーを持つことができるルートを持っている...zuul複数のURL 1つのパス

私は運に次のことを試してみました:

zuul.routes.example.path=/example/** 
zuul.routes.example.serviceId=example 
example.ribbon.eureka.enabled=false 
example.ribbon.eureka.listOfServers=http://127.0.0.1/metrics,http://127.0.0.1/info 

これは単に次のエラーが返されます。

Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: example

私はほとんどのルートでユーレカを使用していますが、特にこのユーレカは使用できません。

2つのURLの間で負荷バランスをとることは可能ですか?

は、以下の答えは設定して、この問題を解決

を解決し、しかし、私は春・ブート・スターター・親を使用していた言及だろう、私はまたCamden.SR7

に依存関係の管理をアップグレードする必要がありました
<dependencyManagement> 
    <dependencies> 
     <dependency> 
     <groupId>org.springframework.cloud</groupId> 
     <artifactId>spring-cloud-dependencies</artifactId> 
<!--   <version>Brixton.SR5</version> --> 
     <version>Camden.SR7</version> 
     <type>pom</type> 
     <scope>import</scope> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 

答えて

2

はい、できます。あなたの代わりに以下のプロパティを試してみてください。

zuul.routes.example.path=/example/** 
zuul.routes.example.serviceId=example 
example.ribbon.NIWSServerListClassName=com.netflix.loadbalancer.ConfigurationBasedServerList 
example.ribbon.listOfServers=http://127.0.0.1/metrics,http://127.0.0.1/info 
+0

私は怖いん喜び、私はまだ同じエラーを取得:/ – Alex

+0

は、私は他の人のために、いくつかの、地域設定ユーレカを使用することはできません。この平均値をしていますか? - https://github.com/spring-cloud/spring-cloud-netflix/issues/564 – Alex

+0

上記のリンクされている問題は非常に古い質問です。上記のプロパティは私のために働く。例示的なサービスだけがローカル設定で動作し、他のサービスはユーレカで動作します。 –

関連する問題