diff --git a/springcloud-service-common/src/main/java/com/kwan/springcloud/config/RestConfig.java b/springcloud-service-common/src/main/java/com/kwan/springcloud/config/RestConfig.java index 9734a9b184ae95e396d71b47147039d49b014948..fde80930bf030bddc48f350bacbeb8eb2205c4a6 100644 --- a/springcloud-service-common/src/main/java/com/kwan/springcloud/config/RestConfig.java +++ b/springcloud-service-common/src/main/java/com/kwan/springcloud/config/RestConfig.java @@ -1,7 +1,7 @@ package com.kwan.springcloud.config; import com.netflix.loadbalancer.IRule; -import com.netflix.loadbalancer.RandomRule; +import com.netflix.loadbalancer.ZoneAvoidanceRule; import org.springframework.cloud.client.loadbalancer.LoadBalanced; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -21,6 +21,8 @@ public class RestConfig { */ @Bean public IRule microIrule() { - return new RandomRule(); + //return new RandomRule(); //轮训 + //return new BestAvailableRule(); + return new ZoneAvoidanceRule(); //新版本默认的策略 } } \ No newline at end of file diff --git a/springcloud-service-goods-9100/src/main/resources/application.yaml b/springcloud-service-goods-9100/src/main/resources/application.yaml index 187b005ec14efb22cd2438be99f774d32768284f..a09fc37460308ddecf1e131636caa1d676cc1460 100644 --- a/springcloud-service-goods-9100/src/main/resources/application.yaml +++ b/springcloud-service-goods-9100/src/main/resources/application.yaml @@ -28,6 +28,8 @@ management: endpoints: web: base-path: /actuator #修改访问路径 2.0之前默认是/ 2.0默认是 /actuator 可以通过这个属性值修改 + exposure: + include: * health: show-details: always #显示健康具体信息 默认不会显示详细信息