zoukankan      html  css  js  c++  java
  • SpringCloud-Eurake坑

    首先遇到的问题

    1. Eurake单台部署,很容易出现自我保护,发现web管理页面一大串红字警告

      • 这个问题通过关闭自我保护机制可以简单解决。。一般集群部署不会出现
      eureka:
        server:
          renewalPercentThreshold: 0.49
          enable-self-preservation: false
      
    2. 服务DOWN的问题,这可能很多原因,包括pom没填全,服务名写错之类的,这里我说的是我遇到的,坑了我好几小时

      • 点开down的应用状态地址,后面加上/health
      • 网页返回信息
      {"description":"Remote status from Eureka server","status":"DOWN"}
      
      • 我检查了好多地方,查了很多博客,终于在一个地方找到个关键点
      • 参考 https://www.cnblogs.com/lodor/p/7849967.html 此博客
      • 总结原因就是客户端启动肯定有地方连接不正常。。可能是数据库,redis,mq等等
      • 我看了日志,他就是没报过错,但我确实找到了我的redis地址是错误的~~坑爹的提示~
      • 我发现有人在很多博客下评论找不到down的原因我觉得就是这个了~~,没报错,就只有单独测试这个客户端,redis报错的时候才能知道了o(╥﹏╥)o
      • 记录下,没报错,但连接返回的信息内容
      2018-09-23 16:07:00.051 [DiscoveryClient-InstanceInfoReplicator-0] WARN  com.netflix.discovery.DiscoveryClient - Saw local status change event StatusChangeEvent [timestamp=1537690020051, current=DOWN, previous=UP]
      2018-09-23 16:07:00.051 [DiscoveryClient-InstanceInfoReplicator-0] WARN  com.netflix.discovery.InstanceInfoReplicator - Ignoring onDemand update due to rate limiter
      2018-09-23 16:07:00.052 [DiscoveryClient-InstanceInfoReplicator-0] INFO  com.netflix.discovery.DiscoveryClient - DiscoveryClient_MEMBER/192.168.1.103:member:8762: registering service...
      2018-09-23 16:07:00.463 [DiscoveryClient-InstanceInfoReplicator-0] INFO  com.netflix.discovery.DiscoveryClient - DiscoveryClient_MEMBER/192.168.1.103:member:8762 - registration status: 204
      
      

      没看出一点和redis相关吧-_-||

    3. 还是服务DOWN问题,继续坑了我一下午。。

      • 如果你是一个父项目多个子项目的,父项目加上了redis的pom,那么你所有子服务有application.yml配置的地方都要加上redis配置,不管你这个项目用不用。。这是我一点点试出来的Ծ‸Ծ~~
    4. 下个问题:
      current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
      Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client
      这问题能引起的原因太多了,所以我加了上边另一句。。还是这种坑爹的不报错问题,访问另一个服务找不到注册中心任何服务,原因就是没引入client包

    <dependency>
    	<groupId>org.springframework.cloud</groupId>
    	<artifactId>spring-cloud-netflix-eureka-server</artifactId>
    </dependency>
    
    1. 在这之后又碰上新问题~~socket time out 超时~,实际是找不到feign定义的name,解决办法:
    eureka:
      client:
        healthcheck:
          enabled: true
        serviceUrl:
          defaultZone: http://localhost:8761/eureka/
      instance:
        instance-id: ${spring.application.name}:${spring.application.instance_id:${server.port}}
        prefer-ip-address: true
    

    加上instance这项,结果变成,只有message没改

    6. 另外推荐个网址,翻译了很多官网的配置 http://www.cnblogs.com/woshimrf/p/springclout-eureka.html

    求大神指点第3点,什么办法能不用这么多多余配置~~

  • 相关阅读:
    tar.gz文件
    Ruby Symbol
    Ruby表达式
    Linux相关命令
    Ruby file
    Tomcat优化
    修改Linux文件的所属用户和组
    Ruby String
    Ruby Range
    HTML5开源专业图像处理引擎——AlloyImage(简称AI)
  • 原文地址:https://www.cnblogs.com/sky-chen/p/9693173.html
Copyright © 2011-2022 走看看