启动报错:
Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://localhost:8761/eureka/}
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect
gateway就是没有注册进eureka,看视频里面的配置是下面这样的就没有问题:
eureka:
instance:
hostname: cloud-gateway-service
client:
fetch-registry: true
register-with-eureka: true
defaultZone: http://eureka7001.com:7001/eureka
而我的就宝上面的错误!
后来我在配置里面加了一段配置:service-url:
eureka:
instance:
hostname: cloud-gateway-service
client:
fetch-registry: true
register-with-eureka: true
service-url:
defaultZone: http://eureka7001.com:7001/eureka
这样启动就没有问题了,在注册中心也看到gateway服务了