大致框架

  • 服务注册与发现:Eureka、Zookeeper、Consul、Nacos
  • 服务负载与调用:ribbon、LoadBalancer、Feign、OpenFeign
  • 服务熔断降级:hysirix、resilience4j、sentinel
  • 服务网关:zuul、gateway
  • 服务分布式配置:SpringCloud Config、Apollo、Nacos
  • 服务总线:Bus、Nacos
  • 服务开发:SpringBoot alt


版本对照

SpringCloud 与 SpringBoot 版本对照


SpringCloud 和 SpringCloudAlibaba 版本对照



创建 SpringCloud 项目


创建父类 Maven 框架

alt


修改父工程的 pom 文件、注意版本依赖关系、删掉 src 文件


创建多个子工程模块

  1. 建 module (可以是Spring Initializr 或者 new Module)
  2. 改 pom (参考 DependencyManager 的用法
  3. 写 YML
  4. 主启动类
  5. 业务类


补充

可以隐藏 .idea 文件

  • 因为项目体量大,只需要留下可修改部分即可 alt

services 里面显示多个服务,方便管理和启动

  • 如何显示: View --》 Tool Windows --》 Services --》 Run Configuration Type --》 SpringBoot alt