SpringCloud
文章平均质量分 53
近年来,微服务趋势大行其道,究其原因,与科技日新月异的发展有关
layman .
蒙多,想娶纳尔就娶纳尔......
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Spring Cloud入门系列(二十五)- Spring Cloud Alibaba之服务熔断与限流Sentinel
@SentinelResource原创 2021-10-27 07:54:39 · 341 阅读 · 0 评论 -
Spring Cloud入门系列(二十四)- Spring Cloud Alibaba之服务熔断与限流Sentinel
熔断降级原创 2021-10-26 09:11:32 · 1161 阅读 · 0 评论 -
Spring Cloud入门系列(二十三)- Spring Cloud Alibaba之服务熔断与限流Sentinel
流控规则配置直接配置(流控效果:快速失败)关联配置(流控效果:快速失败)直接配置(流控效果:预热)应用场景匀速排队原创 2021-10-26 08:17:14 · 326 阅读 · 0 评论 -
Spring Cloud入门系列(二十一)- Spring Cloud Alibaba之服务熔断与限流Sentinel
官方文档:https://github.com/alibaba/Sentinel/wiki/%E4%BB%8B%E7%BB%8Dhttps://sentinelguard.io/zh-cn/docs/introduction.htmlSentinel 是什么随着微服务的流行,服务和服务之间的稳定性变得越来越重要。Sentinel 以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度保护服务的稳定性。Sentinel 具有以下特征:丰富的应用场景:Sentinel 承接了阿里巴巴近 1原创 2021-10-24 16:02:38 · 392 阅读 · 0 评论 -
Spring Cloud入门系列(二十二)- Spring Cloud Alibaba之服务熔断与限流Sentinel
新建模块 cloud-alibaba-sentinel-service8401pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apa原创 2021-10-24 16:04:21 · 339 阅读 · 0 评论 -
Spring Cloud入门系列(二十)- Spring Cloud Alibaba之服务注册与配置中心Nacos
NameSpace,Group,DataIdNacos集群部署官方参考文档:https://nacos.io/zh-cn/docs/cluster-mode-quick-start.html集群模式,请使用 外部MySQL数据库,进行数据持久化Naocs持久化在0.7版本之前,在单机模式时nacos使用嵌入式数据库实现数据的存储,不方便观察数据存储的基本情况。0.7版本增加了支持mysql数据源能力,具体的操作步骤:安装数据库,版本要求:5.6.5+初始化mysql数据库,数据库初始原创 2021-10-23 07:56:26 · 384 阅读 · 0 评论 -
Spring Cloud入门系列(十九)- Spring Cloud Alibaba之服务注册与配置中心Nacos
CAP理论中,nacos既支持 AP ,也支持 CPNacos切换AP或者CP原创 2021-10-22 08:03:26 · 368 阅读 · 0 评论 -
Spring Cloud入门系列(十八)- Spring Cloud Alibaba之服务注册与配置中心Nacos
新建模块 cloud-alibaba-provider-payment9001(服务提供者)pox.xml添加 spring-cloud-starter-alibaba-nacos-discovery<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-原创 2021-10-21 20:34:50 · 364 阅读 · 0 评论 -
Spring Cloud入门系列(十七)- Spring Cloud Alibaba之服务注册与配置中心Nacos
官方文档:https://nacos.io/zh-cn/docs/what-is-nacos.htmlNacos是什么Nacos 致力于帮助您发现、配置和管理微服务。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据及流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。 Nacos 是构建以“服务”为中心的现代应用架构 (例如微服务范式、云原生范式) 的服务基础设施。Nacos能干吗服务发现和服务健康监测动态配置服务动态 DNS 服务原创 2021-10-21 20:18:32 · 415 阅读 · 0 评论 -
Spring Cloud入门系列(十六)- 服务网关之Gateway
断言 predicates官网参考文档:https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#gateway-request-predicates-factoriesgateway的三大术语Route: The basic building block of the gateway. It is defined by an ID, a destination URI, a collection of原创 2021-10-17 15:31:06 · 631 阅读 · 0 评论 -
Spring Cloud入门系列(十五)- 服务网关之Gateway
GateWay的网关路由 有两种配置方式:通过 application.yml 进行配置通过 java代码 的方式进行配置这一章将探讨通过 java代码的方式 配置路由。原创 2021-10-17 15:01:07 · 524 阅读 · 0 评论 -
Spring Cloud入门系列(十四)- 服务网关之Gateway
代码演示新建模块: cloud-gateway9527原创 2021-10-15 08:15:00 · 651 阅读 · 0 评论 -
Spring Cloud入门系列(十三)- 服务网关之Gateway
待续原创 2021-10-13 08:03:02 · 597 阅读 · 0 评论 -
Spring Cloud入门系列(十二)- 服务熔断与降级之Hystrix(已停更,建议切换到Sentinel)
Hystrix仪表盘代码演示新建模块:cloud-consumer-hystrix-dashboard9001原创 2021-10-12 07:59:09 · 610 阅读 · 0 评论 -
Spring Cloud入门系列(十一)- 服务熔断与降级之Hystrix(已停更,建议切换到Sentinel)
前言服务降级,既可以配置在客户端,也可以配置在服务端,需要根据具体的业务需求,进行灵活配置。本文模拟的情况,是在服务端80进行配置。服务降级服务降级,是通过注解 @HystrixCommand 来实现的。/** * 模拟超时操作 * fallbackMethod:服务降级后的回调方法(超时异常or运行异常都会触发) * commandProperties: * isolation.thread.timeoutInMilliseconds:配置Hys原创 2021-10-09 08:32:56 · 612 阅读 · 0 评论 -
Spring Cloud入门系列(十)- 服务熔断与降级之Hystrix(已停更,建议切换到Sentinel)
模块构建新建 客户端 模块:cloud-consumer-feign-hystrix-order80结构图,如下:pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocati原创 2021-10-08 21:44:25 · 580 阅读 · 0 评论 -
Spring Cloud入门系列(九)- 服务熔断与降级之Hystrix(已停更,建议切换到Sentinel)
总述分布式暴露的问题Hystrix的定义Hystrix的三个重要概念服务降级(fallback)服务熔断(break)服务限流(flowlimmit)模块构建新建模块:cloud-provider-hystrix-payment8001pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0"原创 2021-10-08 07:53:55 · 701 阅读 · 0 评论 -
Spring Cloud入门系列(八)- 负载均衡之Open Feign
Open Feign 的超时控制8001端口的PaymentController新增以下代码:/** * openfeign-ribbon 客户端一般默认等待1秒钟 * 故意让它睡眠三秒钟,模拟超时操作 */ @GetMapping("/openfeign/timeout") public String openFeignTimeOut() { try { Thread.sleep(3000); }原创 2021-10-07 21:00:59 · 660 阅读 · 0 评论 -
Spring Cloud入门系列(七)- 负载均衡之Open Feign
OpenFeign是什么OpenFeign能做什么OpenFeign和Feign的区别如何使用代码演示定义新的模块 cloud-consumer-openfeign-order80pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSch原创 2021-10-07 20:45:06 · 663 阅读 · 0 评论 -
Spring Cloud入门系列(六)——负载均衡之Ribbon
概述负载均衡集中式LB进程内LB架构说明其实ribbon已经被Eureka整合进去了。原创 2021-10-07 18:01:53 · 597 阅读 · 0 评论 -
Spring Cloud入门系列(五)——服务注册与发现之Consul(已停更,建议切换到Nacos)
Consul是什么Consul能干什么如何使用官网下载链接:https://www.consul.io/downloads官方使用文档:https://docs.spring.io/spring-cloud-consul/docs/2.2.7.RELEASE/reference/html/默认端口是 8500Eureka,Zookeeper,Consul异同点这就要提及 经典的CAP理论了。因为是分布式架构,所以P一定要保证。因此分布式架构只有两种,就是 AP 和 CPAP架构原创 2021-10-07 16:13:47 · 736 阅读 · 0 评论 -
Spring Cloud入门系列(四)——服务注册与发现之Eureka(已停更,建议切换到Nacos)
服务集群新建相同的模块,更改端口,即可(略)服务发现以 8001为例:DiscoveryClient就是服务发现。8001的PaymentController的代码如下:package com.banana.springcloud.controller;import com.banana.springcloud.entity.CommonResult;import com.banana.springcloud.entity.Payment;import com.banana.spri原创 2021-10-06 17:40:44 · 853 阅读 · 1 评论 -
Spring Cloud入门系列(三)——服务注册与发现之Eureka(已停更,建议切换到Nacos)
新增服务消费者80ApplicationContextConfigpackage com.banana.springcloud.config;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.web.client.RestTemplate;/** * @author原创 2021-10-06 17:21:31 · 617 阅读 · 0 评论 -
Spring Cloud入门系列(二)——服务注册与发现之Eureka(已停更,建议切换到Nacos)
服务注册与发现的定义Eureka组件微服务之间如何调用如何使用新建服务注册中心新增模块,名为:cloud-eureka-server7001该模块就是Eureka注册中心。EurekaMain7001中的代码如下:package com.banana.springcloud;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.Spring原创 2021-10-06 15:09:57 · 620 阅读 · 0 评论 -
Spring Cloud入门系列(一)——准备工作
微服务组件总览版本选型Spring Cloud官方文档:https://spring.io/projects/spring-cloudSpring Cloud Hoxton.SR1Spring Boot 2.2.2.RELEASE新建父工程父工程pom<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http原创 2021-10-05 11:27:05 · 598 阅读 · 0 评论 -
【图文】Nacos集群部署+MySQL持久化配置+Nginx负载均衡
写在最前面Nacos官网文档:https://nacos.io/zh-cn/docs/cluster-mode-quick-start.html环境配置: 操作系统: CentOS7 64位 JDK版本: 1.8 Nacos版本: 1.1.4 MySQL版本: 5.7 Nginx版本: 1.18.0CentOS7安装JDK1.8: https://blog.youkuaiyun.com/single_0910/article/details/113033380CentOS7安装MySQL5.7:h原创 2021-01-24 10:50:30 · 992 阅读 · 0 评论 -
RabbitMQ安装图文教程
1. RabbitMQ是使用erlang语言写的,所以安装RabbitMQ前要先安装erlang`RabbitMQ和erlang版本对应关系: https://www.rabbitmq.com/which-erlang.htmlerlang下载地址:https://www.erlang.org/downloads下载后一路安装,然后配置环境变量(以23.1版本为例).配置环境变量: ERLANG_HOME=G:\Program Files\erl-23.1Path中增加: %ERLANG_H原创 2021-01-20 23:12:47 · 730 阅读 · 0 评论 -
Spring Cloud Ribbon的默认策略RoundRobinRule源码注释
public class RoundRobinRule extends AbstractLoadBalancerRule { private AtomicInteger nextServerCyclicCounter; private static final boolean AVAILABLE_ONLY_SERVERS = true; private static final boolean ALL_SERVERS = false; private static Log原创 2021-01-16 11:51:01 · 1061 阅读 · 7 评论 -
【源码注释】Ribbon的负载均衡策略以及自定义配置
Spring Cloud Ribbon的负载均衡策略以及自定义配置1. Ribbon是一个基于HTTP和TCP的客户端负载均衡工具,它基于NetFlix Ribbon实现,可以将面向服务的REST请求自动转换为客户端负载均衡的服务调用。2. 核心组件 **`com.netflix.loadbalancer.IRule`类是所有负载均衡策略的父类,负载均衡策略是基于它的子类实现的,UML图如下:**3. ribbon的七种负载均衡模式**默认策略为:**`RoundRobinRule(轮询策原创 2021-01-15 20:52:47 · 708 阅读 · 0 评论
分享