Zuul com.netflix.zuul.exception.ZuulException: Forwarding error,简单点,说话的方式简单点~

eureka_client_provider 端。(service id 必须是spring.application.name不能是 eureka.instance.appname)

application.yml

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8000/eureka/,http://localhost:8001/eureka/
  instance:
#    appname: hystrix # 不可以用这个
    prefer-ip-address: true
    instanceId: eureka_instance_id_7002
    
server:
  port: 7002
spring:
  application:
    name: hystrix  # service id  必须是这个

eureka_client_Zuul 端(两点注意事项,如下注释写出)

application.yml

server:
  port: 6001
eureka:
  client:
    service-url:
      defaultZone: http://localhost:8000/eureka/,http://localhost:8001/eureka/
  instance:
    instance-id: zuul_instance_6001
    prefer-ip-address: true

spring:
  application:
    name: zuul_application_6001


zuul:
  host:
    connect-timeout-millis: 60000   # 这个必须写
  routes:
    hystrix-service-1:  # 这个必须写,自定义名称就可以
      path: /hystrixservice/**
      serviceId: hystrix

测试url

http://localhost:6001/hystrixservice/[加上provider端的请求url]

你可能感兴趣的:(spring,cloud)