写点什么

SpringCloud 学习总结(思维导图),学习 mysql 基础教程

用户头像
极客good
关注
发布于: 刚刚

server:


port: 8088


spring:


application:


name: service-consumer #将来会作为微服务的名称


eureka:


client:


service-url:


defaultZone: http://localhost:10086/eureka


fetch-registry: true #是否拉取服务,默认为 true


registry-fetch-interval-seconds: 5 #拉取服务的间隔时间


service-provider:


ribbon:


NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule


hystrix:


command:


default:


execution:


isolation:


thread:


timeoutInMilliseconds: 6000 #设置 hystrix 的超时时间为 6000ms


feign:


hystrix:


enabled: true #开启 Feign 的熔断功能


Eureka 服务注册中心:


server:


port: 10086


spring:


application:


name: ly-eureka #将来会作为微服务名称注入到 eureka 容器


eureka:


client:


service-url:


defaultZone: http://localhost:${server.port}/eureka


#server:


#eviction-interval-timer-in-ms: 5000 #失效剔除时间,单位毫秒


#enable-self-preservation: false #关闭自我保护状态


Zuul 网关:


server:


port: 10010


spring:


application:


name: ly-zuul


#zuul: #路由配置方式 1


#routes:


#service-provider:


#path: /service-provider/**


#url: http://localhost:8081


#zuul: #路由配置方式 2


#routes:


#service-provider:


#path: /service-provider/**


#serviceId: service-provider


zuul: #路由配置方式 3,推荐


routes:


service-provider: /provider/**


service-consumer: /consumer/**


prefix: /api


eureka:


client:


service-url:


defaultZone: http://localhost:10086/eureka


启动器相关:


<dependency>


<groupId>org.springframework.boot</groupId>


<artifactId>spring-boot-starter-web</artifactId>


</dependency>


<dependency>


<groupId>org.mybatis.spring.boot</groupId>


<artifactId>mybatis-spring-boot-starter</artifactId>


<version>2.1.4</version>


</dependency>


<dependency>


<groupId>tk.mybatis</groupId>


<artifactId>mapper-spring-boot-starter</artifactId>


<version>2.0.4</version>


</dependency>


<dependency>


<groupId>mysql</groupId>


<artifactId>mysql-connector-java</artifactId>


<version>8.0.11</version>


<scope>runtime</scope>


</dependency>


<dependency>


<groupId>org


【一线大厂Java面试题解析+核心总结学习笔记+最新架构讲解视频+实战项目源码讲义】
浏览器打开:qq.cn.hn/FTf 免费领取
复制代码


.springframework.boot</groupId>


<artifactId>spring-boot-starter-jdbc</artifactId>


</dependency>


<dependency>


<groupId>org.springframework.boot</groupId>


<artifactId>spring-boot-starter-actuator</artifactId>


</dependency>


<dependency>


<groupId>org.springframework.cloud</groupId>


<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>


</dependency>


<dependency>

用户头像

极客good

关注

还未添加个人签名 2021.03.18 加入

还未添加个人简介

评论

发布
暂无评论
SpringCloud 学习总结(思维导图),学习mysql基础教程