2017-12-05 4 views
15

私はSpring MVCとSpringブートフレームワークを使用してSpring Cloud Microserviceを開発しようとしています。そしてユーレカサーバー、ズール、リボン、ヒステリックス、タービンは春の雲に使用します。私はすでにマイクロサービスを開発し、hystrixダッシュボードのみを実装しました。私はhystrixダッシュボードを取ることができます。今私はより多くのサービスを実装しています。だから私は監視の集約のためにタービンを選んだ。しかし、それはダッシュボードを取得していません。別のスプリングブートプロジェクトでタービンを実装しました。 タービンのダッシュボードがSpring Cloud Microserviceに集約用にロードされていません

私のpom.xmlを含む

<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-actuator</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-hystrix</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId> 
</dependency> 
<dependency> 
    <groupId>org.springframework.cloud</groupId> 
    <artifactId>spring-cloud-starter-turbine</artifactId> 
</dependency> 

そして、私の主なクラス含む、

@SpringBootApplication 
@EnableHystrixDashboard 
@EnableCircuitBreaker 
@EnableTurbine 

public class ZTurbineClientApplication { 

    public static void main(String[] args) { 
    SpringApplication.run(ZTurbineClientApplication.class, args); 
    } 
} 

そして、私のタービンプロジェクトが含まれているファイルをapplication.properties、

server.port=8085 
spring.application.name=espace-Turbine 
eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/ 
eureka.client.register-with-eureka=true 
eureka.client.fetch-registry=true 
turbine: 
aggregator: 
    clusterConfig: APPCLUSTER 
app-config: espaceService1,espaceService2 
instanceUrlSuffix.APPCLUSTER: /hystrix.stream 

そして、私の前の最初のサービスのapplication.propertiesファイル

eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/ 
eureka.client.register-with-eureka=true 
eureka.client.fetch-registry=true 
spring.application.name=espaceService1 
server.port=8080 
eureka: 
    instance: 
    prefer-ip-address: true 
    leaseRenewalIntervalInSeconds: 3 
    leaseExpirationDurationInSeconds: 3 
    metadata-map: 
     cluster: APPCLUSTER 

そして、第2のサービスのアプリケーションのプロパティファイルが含まれ、

eureka.client.serviceUrl.defaultZone=http://localhost:8071/eureka/ 
eureka.client.register-with-eureka=true 
eureka.client.fetch-registry=true 
spring.application.name=espaceService2 
server.port=8081 
eureka: 
    instance: 
    prefer-ip-address: true 
    leaseRenewalIntervalInSeconds: 3 
    leaseExpirationDurationInSeconds: 3 
    metadata-map: 
     cluster: APPCLUSTER 

これらは私の実装の詳細です。

URL「http://localhost:8085/hystrix.dashboard」を送信した後。貼り付けた "http://localhost:8085/turbine.stream?cluster=APPCLUSTER"しかし、 "Command Metric Streamに接続できません"のようなエラーが発生しました。以下のスクリーンショットを追加する。あなたはコンマからスペースを削除する必要が

enter image description here

enter image description here

+0

はあなたですタービンをhystrix.streamに向ける?回路ブレーカを持つコードパスが実行されていますか? – spencergibb

+0

私はすでにhystrixでサービスを実装しています。その後、タービンを使用してモニタリングを集計しようとしています。hystrixダッシュボードページで、私はturbine.stream..serviceとタービンプロジェクトを分離しようとしています。そしてサービスでは、回路ブレーカ – Jacob

答えて

0

はあなたが異なるクラスタ名から集計ストリームをすることはできません、いずれかのエスパス・Second_Microserviceの両方で1人のクラスタ名を使用するサービス名

turbine.aggregator.cluster-config=espace-Second_Microservice,espaceFirst_Microservice 

を分離しましたespace-First_Microserviceを使用するか、クラスタをまったく使用しないでください。

To define one cluster name use below config 

    eureka: 
     instance: 
     prefer-ip-address: true 
     leaseRenewalIntervalInSeconds: 3 
     leaseExpirationDurationInSeconds: 3 
     metadata-map: 
      cluster: APPCLUSTER 

使用すると、以下のタービンのための設定を述べた

turbine: 
    aggregator: 
    clusterConfig: APPCLUSTER 
    app-config: espace-Second_Microservice,espace-First_Microservice 
    instanceUrlSuffix.APPCLUSTER: /hystrix.stream 

使用します。http:// {タービンホスト}:{タービンポート} /turbine.stream?cluster=APPCLUSTER Hystrixダッシュボードの

+0

はいを​​実装しました。上記に従って修正しました。しかし、 "Command Metric Streamに接続できませんでした"という画面にはまだエラーが表示されます。また、遅れてご返事申し訳ありません。私はコードを変更しています。上記を参照してください。 – Jacob

+0

yamlファイルとプロパティファイルの構成を混在させています。 .propertiesファイルを使用している場合は、プロパティファイル形式で設定を定義する必要があります。 –

+0

eureka.instance.preferIpAddress = true eureka.instance.leaseRenewalIntervalInSeconds = 3 eureka.instance。leaseExpirationDurationInSeconds = 3 eureka.instance.metadataMap.cluster = APPCLUSTER –

関連する問題