项目作者: ReturnTears

项目描述 :
SpringCloud全家桶、SpringCloud Alibaba
高级语言: Java
项目地址: git://github.com/ReturnTears/allst-springcloud-parent.git
创建时间: 2021-06-07T16:18:46Z
项目社区:https://github.com/ReturnTears/allst-springcloud-parent

开源协议:

下载


SpringCloud

  1. 1、分布式属性
  2. 2、服务注册中心
  3. Eureka Server
  4. 127.0.0.1 AllstCloudEurekaServerA 对应8761
  5. 127.0.0.1 AllstCloudEurekaServerB 对应8762
  6. Eureka Client细节
  7. heart beat 1/30s -> 90s 失效
  8. push
  9. Eureka Server细节
  10. 服务下线
  11. 失效剔除 1/60s -> 90s 注销实例
  12. 自我保护
  13. 建议生成环境打开自我保护机制
  14. ribbon负载均衡策略
  15. 轮询策略
  16. 随机策略
  17. 重试策略
  18. 最小连接数策略
  19. 可用过滤策略
  20. 区域权衡策略
  21. Hystrix 熔断器
  22. 雪崩效应解决方案:
  23. 服务熔断
  24. 服务降级
  25. 服务限流
  26. 服务提供者处理超时,熔断,返回错误信息:
  27. This application has no explicit mapping for /error, so you are seeing this as a fallback.
  28. Thu Apr 22 23:27:50 CST 2021
  29. There was an unexpected error (type=Internal Server Error, status=500).
  30. findResumeOpenStateTimeOut timed-out and fallback failed.
  31. com.netflix.hystrix.exception.HystrixRuntimeException: findResumeOpenStateTimeOut timed-out and fallback failed.
  32. Hystrix舱壁模式
  33. GateWay网关
  34. Nacos数据模型(领域模型)
  35. Namespace 包含 Group 包含 Service/DataId
  36. Namespace:命名空间,对不同的环境进行隔离, 不同的命名空间是隔离的, 其中的服务不能相互调用
  37. Group:分组
  38. Service:某一个服务
  39. DataId:某个项目的具体配置集文件
  40. Nacos Server数据持久化到MySQL
  41. nacos-db.sql文件在src\main\resources\nacos-db.sql
  42. 修改Nacos安装包中conf目录下application.properties文件中:
  43. **************Config Module Related Configurations****************
  44. ### If use MySQL as datasource:
  45. spring.datasource.platform=mysql
  46. ### Count of DB:
  47. db.num=1
  48. ### Connect URL of DB:
  49. db.url.0=jdbc:mysql://127.0.0.1:3306/cloud?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
  50. db.user=root
  51. db.password=123456
  52. 然后重启Nacos即可
  53. Nacos配置中心
  54. SpringCloud+Bus >>
  55. 1、在GitHub上添加配置文件
  56. 2、创建Config Server配置中心->从Github上去下载配置信息
  57. 3、具体的微服务中配置Config Client -> ConfigServer获取配置信息
  58. Nacos >>
  59. Nacos分布式配置要简单很多
  60. 1Nacos Server中添加配置信息
  61. 2、改造具体的微服务,使其成为Nacos Config Client

Error

  1. 查看所有端口和PID: netstat -ano
  2. 对应的端口对应的PID 输入指令找到对应的进程: tasklist | findstr pid
  3. 杀掉该进程: taskkill /f /t /im java.exe

Remark

  1. 在缺少.iml文件项目下运行mvn idea:module命令,完成后将自动生成.iml文件
  2. "spring-cloud": {
  3. "Finchley.M2": "Spring Boot >=2.0.0.M3 and <2.0.0.M5",
  4. "Finchley.M3": "Spring Boot >=2.0.0.M5 and <=2.0.0.M5",
  5. "Finchley.M4": "Spring Boot >=2.0.0.M6 and <=2.0.0.M6",
  6. "Finchley.M5": "Spring Boot >=2.0.0.M7 and <=2.0.0.M7",
  7. "Finchley.M6": "Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1",
  8. "Finchley.M7": "Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2",
  9. "Finchley.M9": "Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE",
  10. "Finchley.RC1": "Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE",
  11. "Finchley.RC2": "Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE",
  12. "Finchley.SR4": "Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT",
  13. "Finchley.BUILD-SNAPSHOT": "Spring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3",
  14. "Greenwich.M1": "Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE",
  15. "Greenwich.SR5": "Spring Boot >=2.1.0.RELEASE and <2.1.15.BUILD-SNAPSHOT",
  16. "Greenwich.BUILD-SNAPSHOT": "Spring Boot >=2.1.15.BUILD-SNAPSHOT and <2.2.0.M4",
  17. "Hoxton.SR4": "Spring Boot >=2.2.0.M4 and <2.3.1.BUILD-SNAPSHOT",
  18. "Hoxton.BUILD-SNAPSHOT": "Spring Boot >=2.3.1.BUILD-SNAPSHOT"
  19. }
  20. https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies
  21. https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent