• springcloud11----turbine


    package com.itmuch.cloud;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.cloud.netflix.turbine.EnableTurbine;
    
    //一个turbine server就写完了
    //turbine是监控整个集群的,
    @EnableTurbine
    @SpringBootApplication
    public class TurbineApplication {
      public static void main(String[] args) {
        SpringApplication.run(TurbineApplication.class, args);
      }
    }
    server:
      port: 8031
      #http://localhost:8031/turbine.stream
    spring:
      application:
        name: microservice-hystrix-turbine
    #turbine加入eureka
    eureka:
      client:
        serviceUrl:
          defaultZone: http://user:password123@localhost:8761/eureka
      instance:
        prefer-ip-address: true
      #turbine加入eureka
    turbine:
      aggregator:
        clusterConfig: default
      #监控ribbon-with-hystrix集群(多个端口)和feign-with-hystrix集群(多个状态)
      appConfig: microservice-consumer-movie-ribbon-with-hystrix2,microservice-consumer-movie-feign-with-hystrix
      clusterNameExpression: "'default'"
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <parent>
            <groupId>com.itmuch.cloud</groupId>
            <artifactId>microservice-spring-cloud</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </parent>
    
        <artifactId>microservice-hystrix-turbine</artifactId>
        <packaging>jar</packaging>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        
        <!-- turbine的依赖 -->
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-turbine</artifactId>
            </dependency>
        </dependencies>
    
    </project>

    turbine2的yml文件

    server:
      port: 8031
    spring:
      application:
        name: microservice-hystrix-turbine
    eureka:
      client:
        serviceUrl:
          defaultZone: http://user:password123@localhost:8761/eureka
      instance:
        prefer-ip-address: true
    turbine:
      aggregator:
        clusterConfig: MICROSERVICE-CONSUMER-MOVIE-RIBBON-WITH-HYSTRIX2
      appConfig: microservice-consumer-movie-ribbon-with-hystrix2
      
    turbine.instanceUrlSuffix.MICROSERVICE-CONSUMER-MOVIE-RIBBON-WITH-HYSTRIX2: /ribbon/hystrix.stream
    
    logging: 
      level:
        root: INFO
        com.netflix.turbine.monitor: DEBUG

    turbine3的yml文件

    server:
      port: 8031
    spring:
      application:
        name: microservice-hystrix-turbine
    eureka:
      client:
        serviceUrl:
          defaultZone: http://user:password123@localhost:8761/eureka
      instance:
        prefer-ip-address: true
    turbine:
      aggregator:
        clusterConfig: MICROSERVICE-CONSUMER-MOVIE-RIBBON-WITH-HYSTRIX3
      appConfig: microservice-consumer-movie-ribbon-with-hystrix3
      
    logging: 
      level:
        root: INFO
        com.netflix.turbine.monitor: DEBUG

    microservice-consumer-movie-ribbon-with-hystrix2的yml文件

    spring:
      application:
        name: microservice-consumer-movie-ribbon-with-hystrix2
    server:
      port: 8010
      context-path: /ribbon   #url的前缀
    eureka:
      client:
        healthcheck:
          enabled: true
        serviceUrl:
          defaultZone: http://user:password123@localhost:8761/eureka
      instance:
        prefer-ip-address: true
        home-page-url-path: /ribbon
    hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
    
    #http://localhost:8761/eureka/apps/microservice-consumer-movie-ribbon-with-hystrix2

    microservice-consumer-movie-ribbon-with-hystrix3的yml文件

    #一个应用有2个端口,一个管理端口一个访问端口
    management: # spring-boot-starter-acturator管理端口
      port: 8081
    spring:
      application:
        name: microservice-consumer-movie-ribbon-with-hystrix3
    server:
      port: 8010 #访问端口
      context-path: /ribbon
    eureka:
      client:
        healthcheck:
          enabled: true
        serviceUrl:
          defaultZone: http://user:password123@localhost:8761/eureka
      instance:
        prefer-ip-address: true
        metadata-map:
          management.port: 8081
    hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
  • 相关阅读:
    paip.oracle 10G 在WIN7安装总结
    paip.提升用户体验提取FLASH中图片
    paip.提升效率质量控制代码风格模板化
    paip.提升性能首页性能加快解决方案
    PAIP.提升安全性更好的签名HASH算法
    银联支付接口常见错误总结
    paip.提升用户体验WEB程序页面的手机及平板浏览器兼容支持
    paip.中国银联接口错误码总结
    paip.提升用户体验提高兼容性无JS支持总结
    paip. lbmall V3.1.1 乐彼多用户商城系统的安全漏洞总结
  • 原文地址:https://www.cnblogs.com/yaowen/p/9147898.html
Copyright © 2020-2023  润新知