03 2020 档案
摘要:1.Docker开启远程访问连接 备注: 1)Linux是CentOS7版本 2)安装Docker可参考: https://www.cnblogs.com/tianhengblogs/p/12520226.html 3)编辑docker.service文件 vi /lib/systemd/syste
阅读全文
摘要:前言 公共镜像仓库 官方:https://hub.docker.com/ 基于各个软件开发或者软件提供方开发的 非官方:其它组织或公司开发的镜像,供大家免费使用 私有镜像仓库 用于存放公司内部的镜像,不提供给外部使用 1.访问阿里云容器镜像服务地址 地址: https://cr.console.al
阅读全文
摘要:1.添加yum源 yum install epel-release –y yum clean all yum list 2.安装并运行Docker yum install docker-io –y systemctl start docker 3.检查安装结果 docker info 图: 4.另附
阅读全文
摘要:1、概念 Docker 镜像 - Docker images 容器运行时的只读模板,操作系统+软件运行环境+用户程序 class User{ private String userName; private int age; } Docker 容器 - Docker containers: 容器包含
阅读全文
摘要:介绍和使用场景 1)什么是消息 一个事件,需要广播或者单独传递给某个接口 2)为什么使用这个 配置更新了,但是其他系统不知道是否更新 SpringCloud配置中心可参考: https://www.cnblogs.com/tianhengblogs/p/12508120.html 1.安装Rabbi
阅读全文
摘要:1.前提 配置中心已经完成配置 参考 https://www.cnblogs.com/tianhengblogs/p/12507862.html 2.添加依赖 <!-- config client --> <dependency> <groupId>org.springframework.cloud
阅读全文
摘要:1. 什么是配置中心 统一管理配置,怏速切换各个环境的配置 相关产品:百度的 discont https://github.com/knightliao/disconf阿里的diamand https://github.com/takeseem/diamondspringcloud的configs-
阅读全文
摘要:1.前提 已经配置Sleuth,可参考 https://www.cnblogs.com/tianhengblogs/p/12504195.html 2.什么是Zipkin? 官网:https://zipkin.io/大规模分布式系统的APM工具( Application Performance Ma
阅读全文
摘要:1. 官方文档 https://spring.io/projects/spring-cloud-sleuth#overview 什么是Sleuth? 一个组件,专门用于追踪每个请求的完整调用链路 最主要功能? 做日志埋点 2.添加依赖 <dependency> <groupId>org.spring
阅读全文
摘要:前提: 已经配置Zuul网关 参考: https://www.cnblogs.com/tianhengblogs/p/12495370.html 限流方式: 1)nginx层限流 2)网关层限流 1.添加限流过滤器 import com.alibaba.fastjson.JSON; import c
阅读全文
摘要:前提: 已经配置Zuul网关 参考: https://www.cnblogs.com/tianhengblogs/p/12495370.html 1.添加登录过滤器 import com.alibaba.fastjson.JSON; import com.netflix.zuul.ZuulFilte
阅读全文
摘要:报错信息: java.lang.IllegalStateException: Failed to load property source from location ‘classpath:/application.yml 解决方法: File -> Settings -> File Encodin
阅读全文
摘要:1 1)报错信息 Description: The bean 'counterFactory', defined in class path resource [org/springframework/cloud/netflix/zuul/ZuulServerAutoConfiguration$Zu
阅读全文
摘要:简介 API Gateway,时系统的唯一对外的入口,介于客户端和服务端之间的中间层,处理非业务功能, 提供路由请求,鉴权,监控,缓存,限流等功能 统一接入 智能路由 AB测试、灰度测试 负载均衡、容灾处理 日志埋点(类似 Nignx日志)流量监控 限流处理 服务降级安全防护 鉴权处理 监控 机器网
阅读全文
摘要:1.修改application.yml配置 logging: level: org.springframework.web: TRACE 2.启动项目后,查看地址
阅读全文
摘要:前提: 配置了熔断或者Feign降级的接口才会显示在仪表盘 参考: https://www.cnblogs.com/tianhengblogs/p/12487495.html 断路器原理: 1.添加依赖 <!-- 仪表盘监控 --> <dependency> <groupId>org.springf
阅读全文
摘要:官方文档: https://github.com/Netflix/Hystrix/wiki/Configuration 1)execution.isolation.strategy 隔离策略 THREAD 线程池 (默认) 它在单独的线程上执行,并发请求受线程池中线程数的限制 SEMAPHORE 信
阅读全文
摘要:前言: 在添加熔断降级服务的情况下,再进行报警处理 熔断降级服务博客地址: https://www.cnblogs.com/tianhengblogs/p/12487495.html 前提: 需要安装Redis 1.添加依赖 <dependency> <groupId>org.springframe
阅读全文
摘要:1.GitHub地址 https://github.com/Netflix/Hystrix https://github.com/Netflix/Hystrix/wiki 官方文档 https://cloud.spring.io/spring-cloud-static/spring-cloud-ne
阅读全文
摘要:1.熔断: 相当于保险丝,为了防止整个系统故障,包含自己和整个下游服务 订单服务 -》商品服务 -》用户服务 (还有其它服务会调用此服务,就可能出现异常)-》熔断 2.降级: 抛弃一些非核心的接口和数据 旅行箱的例子: 只带核心的物品,抛弃非核心的,等有条件的时候再去携带这些物品 3.熔断和降级互相
阅读全文
摘要:public void test() { try { //线程休眠1秒 Thread.sleep(1000); //推荐 //线程休眠1秒 TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(
阅读全文
摘要:1.官方文档 https://cloud.spring.io/spring-cloud-static/spring-cloud-openfeign/2.2.2.RELEASE/reference/html/ 2.添加依赖 <dependency> <groupId>org.springframewo
阅读全文
摘要:1.Ribbon中支持的负载均衡策略 点击工具栏"Navigate" ->"Type Hierarchy",弹出接口继承表格 2.负载均衡策略规则 RandomRule:随机选择一个server(推荐,每个Server配置一样时) BestAvailabl:选择一个最小的并发请求的server,逐个
阅读全文
摘要:1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>o
阅读全文
摘要:1. Ctrl + Alt + B 查看接口实现类 Ctrl + Alt + Shift + U 查看类或接口的继承结构 Ctrl + Alt + Shift + N 查找文件
阅读全文
摘要:现象: 在cmd命令行窗口输入startup后,显示the catalina_home environment variable 解决方法: 修改/bin/startup.bat文件 在文件中添加以下配置 重新打开命令行窗口,输入startup,正常启动Tomcat
阅读全文
摘要:问题: 双击启动文件时,弹出cmd命令行窗口后立即消失 原因: 安装完jdk后,没有配置JAVA_HOME
阅读全文
摘要:1.深度克隆一个对象 import org.springframework.beans.BeanUtils; UserInfoDto user = new UserInfoDto(); user.setName("Tony"); UserInfoDto user2 = new UserInfoDto
阅读全文
摘要:目的: 获取application.properties配置文件的属性值 代码 @Value("${server.port}") private String port;
阅读全文