# aplus-microservice-parent **Repository Path**: chen-jf/aplus-microservice-parent ## Basic Information - **Project Name**: aplus-microservice-parent - **Description**: 微服务框架搭建 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2019-05-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ###修改host文件: ```text 127.0.0.1 www.eureka-server1.com 127.0.0.1 www.eureka-server2.com 127.0.0.1 www.eureka-server3.com ``` ###启动Eureka高可用 ```text java -jar aplus-microservice-eureka-1.0-SNAPSHOT.jar --spring.profiles.active=eureka-server1 java -jar aplus-microservice-eureka-1.0-SNAPSHOT.jar --spring.profiles.active=eureka-server2 java -jar aplus-microservice-eureka-1.0-SNAPSHOT.jar --spring.profiles.active=eureka-server3 ``` aplus-microservice-producer主要提供基本单表操作,可以理解为我们的rest api接口层。 aplus-microservice-consumer主要调用rest api接口,在上层做聚合操作,最终暴露出去 ###actuator访问地址 ```text http://localhost:9000/actuator/ ``` ###注意: ```text 1.微服务的启动顺序很重要 2.手动更新Spring Cloud bus config 需要使用Post方式访问 http://localhost:6061/actuator/bus-refresh 3.任何时候都不要从前段计算价钱传递到后端,避免传输的时候被串改 ``` ###端口号 ```text EurekaServer-1 10001 EurekaServer-2 10002 EurekaServer-3 10003 ConfigServer-1 20001 ConfigServer-2 20002 ZuulServer-1 30001 ZuulServer-1 30002 ``` ###遇到问题 配置完Zuul之后访问总是不稳定 There was an unexpected error (type=Gateway Timeout, status=504). com.netflix.zuul.exception.ZuulException: Hystrix Readed time out ```