springcloud 笔记
官方教程
- guide
伪官方教程
https://springcloud.cc
https://legacy.gitbook.com/book/eacdy/spring-cloud-book/details
Actuator
https://blog.csdn.net/alinyua/article/details/80009435
management.endpoints.web.exposure.include="*" 或者 "hystrix.stream" 包含采集的数据.
健康检查
- 配置法:
management:
health:
solr:
enabled: false
db:
enabled: false
elasticsearch:
enabled: false
jms:
enabled: false
mail:
enabled: false
mongo:
enabled: false
rabbit:
enabled: false
redis:
enabled: false
- 代码
/** 系统有以下项:
* rabbitHealthIndicator
* diskSpaceHealthIndicator
* mongoHealthIndicator
* refreshScopeHealthIndicator
* discoveryClient
* configServerHealthIndicator
* hystrixHealthIndicator
*/
@Component("rabbitHealthIndicator")
open class rabbitHealthIndicator(var rabbitTemplate: RabbitTemplate) : RabbitHealthIndicator(rabbitTemplate) {
override fun doHealthCheck(builder: Health.Builder?) {
//跳过
}
}
使用代码,也可以增加额外的分健康检查.
config
启用配置中心:
命令行参数不能覆盖 远程配置中心配置 的问题排查
spring-cloud-context-2.0.0.RC2-sources.jar!/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapProperties.java
这个文件 三个属性:
- allowOverride = true
- overrideNone = false
- overrideSystemProperties = true
看注释根本理解不了。 在get 方法上打断点开调试。
实验结果:
config 使用文件系统, 不使用git (使用git ,修改配置需要提交 )
spring.profiles.active: native
spring.cloud.config.profile: native
spring.cloud.config.server.native.search-locations: file:/home/udi/IdeaProjects/app.shop.java/config/git/{application}在 配置中心相应的 application应用配置文件中 添加 spring.cloud.config.overrideNone: true
文件位置: /home/udi/IdeaProjects/app.shop.java/config/git/shop-api/application.yml
高可用
unavailable-replicas
http://chenja.iteye.com/blog/2375104
https://blog.csdn.net/u012470019/article/details/77973156
https://www.cnblogs.com/sweetchildomine/p/8830863.html
有效:
1.eureka.instance.appname 必须等于 spring.application.name 并且不可缺省,所以直接占位符 appname: ${spring.application.name}
2.prefer-ip-address: 必须为false 或者缺省
3.fetch-registry 必须非false 或者缺省
4. 所有的设置:
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
springcloud 笔记的更多相关文章
- SpringCloud笔记六:Hystrix
目录 Hystrix是什么? Hystrix服务熔断 新建Hystrix项目 修改yml Maven的pom.xml添加hystrix引用 修改Controller Hystrix服务降级 修改api ...
- SpringCloud笔记五:Feign
目录 什么是Feign? 有了Ribbon我还要Feign干嘛? 新建consumer-feign 修改api项目 引入Maven文件 新建feign的接口 启动项目 报错 发泄发泄心情,一个段落 什 ...
- SpringCloud笔记四:Ribbon
目录 什么是Ribbon? Ribbon的配置 Maven引入 开启注解 Ribbon负载均衡 新建provider8002和8003 Ribbon核心组件IRule Ribbon自定义 什么是Rib ...
- SpringCloud笔记三:Eureka服务注册与发现
目录 什么是Eureka? Eureka注册的三大步 第一步,引用Maven 第二步,配置yml 第三步,开启Eureka注解 新建Eureka子项目 把provider子项目变成服务端 Eureka ...
- SpringCloud笔记二:搭建项目基础框架
目录 搭建框架 新建父工程 新建子工程api 新建子工程提供者provider 新建消费者consumer 总结 搭建框架 我们的SpringCloud微服务框架是父子工程,有一个父工程,剩下的都是子 ...
- SpringCloud笔记一:扫盲
目录 前言 什么是微服务? 微服务的优缺点是什么? 微服务之间是如何通讯的? SpringCloud和Dubbo有哪些区别? SpringCloud和SpringBoot的关系? 什么是服务熔断?什么 ...
- springCloud笔记
分布式和集群的理解:比如在一个厨房有两个厨师,一个炒菜,一个洗菜,各自做不同的事情,但是却在合作,这种叫做分布式,两个都在炒菜或者都在做菜,就叫做集群. eureka的是springCloud的注册中 ...
- springcloud 笔记-服务注册中心
1.搭建springcloud服务注册中心需要添加eureka的依赖: <?xml version="1.0" encoding="UTF-8"?> ...
- SpringBoot+SpringCloud 笔记
SpringBoot总结 使用Typora打开https://pan.baidu.com/s/1tXS45j6ooXpnzhy1Zp78Gw 提取码: c8fi SpringCloud总结 使用XMi ...
随机推荐
- SMP多核启动
在 Linux系统中,对于多核的ARM芯片而言,在Biotron代码中,每个CPU都会识别自身ID,如果ID是0,则引导Bootloader和 Linux内核执行,如果ID不是0,则Biotron一般 ...
- February 4th, 2018 Week 6th Sunday
Hope clouds observation. 心怀希望会蒙蔽双眼,影响判断. Almost every of us thinks we would be the master of our liv ...
- transition: 0.2s all ease;
/* 全部样式 0.2秒 缓动*/ transition: 0.2s all ease;
- android 布局文件中xmlns:android="http://schemas.android.com/apk/res/android"
http://blog.163.com/benben_long/blog/static/199458243201411394624170/ xmlns:android="http://sch ...
- jquery ajax 方法实例
每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code 直接上代码, ajax实例: $.ajax({ type : & ...
- php 对象教程
[PHP面向对象(OOP)编程入门教程]6.如何去使用对象中的成员 作者:qianyunlai.com 发布于:2012-05-19 15:02 分类:PHP基础 浏览(280) 上面看到PHP ...
- Arduino IDE for ESP8266 (0) 官方API
http://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/readme.html 0 简单的连接到WIFI #include <ES ...
- JS进阶之---函数,立即执行函数
一.函数 函数声明.函数表达式.匿名函数 函数声明:使用function关键字声明一个函数,再指定一个函数名,叫函数声明.function name () { … } 函数表达式:使用function ...
- Spring Security 用户认证原理分析
本文基于 spring-security-core-5.1.1 和 tomcat-embed-core-9.0.12. 核心原理 用户通过 username 和 password 登录时,后端会经过一 ...
- mysql基础讲解