micro spring-cloud service

Direct look at this as a big brother to explain

https://www.cnblogs.com/jajian/p/9973555.html

Micro Services

  What microService

  Micro-services architecture is a system-level thinking

 

What System Architecture

  Research and development of large-scale comprehensive ways and means of software product (similar to building a house)

  System architecture framework is thinking, thinking began in the framework of demand.

 

The origin of the idea of ​​micro-services framework

  Micro also began thinking of the service demand, software development framework as currently designed can not meet the development needs of the time

  We will be thinking about how to improve and optimize the framework to meet demand

 

Periphery

  2014 3

He raised a few points

  - A system is composed of multiple small services together constitute the program

  -  different services running in a different process

  - each service as a separate business development

  -  Standalone Deployment

  -  Distributed Management

Realization of ideas

 

Mainstream solution micro Services Architecture ideas

Ali

Dubbo ( open source )

Zookeeper

SpringBoot

Spring system

Spring cloud

Series of integrated services for micro-development framework

Spring boot

 

What is Spring Cloud

After the evolution of systems development services to micro, involving technology a lot, the Spring framework for maintenance

Team pivotal to these open source technologies integrated together to maintain a system upgrade,

Version of the product promotion, the popular micro-services technology, low barriers to entry.

Services for small and medium micro-architecture solutions.

 

Web evolution of system architecture

Centralized development

 

 

  

Vertical Split

 

 

 

Distributed Services

 

 

 

 

  1. Micro Services Architecture

 

The basic concept of Micro Service

Registration Authority (management and maintenance of micro-services )

服务网关(负责微服务权限验证和登录认证

学习Spring cloud各种框架的使用

  • Spring cloud框架的学习主要是思想上面的理解,spring cloud框架的使用延续了spring框架和springboot框架的简化,使用上面非常简单,关键还是思想上面的同步和理解

 

Spring cloud的核心概念

注册中心

注册中心也称服务中心,管理维护系统中的各个服务

  • 注册中心就是抽象出来解决服务访问和调用的问题的单元,包括服务的注册,服务的发现,服务的熔断、服务的负载、服务的降级等

 

服务的注册

也就是把服务注册(登记)注册中心

 

服务的发现

注册中心具有主动发现服务的功能(当一个服务在集群服务上启动的时候,需要自动出现在服务中心的功能列表中)

 

服务的熔断

 

服务的负载

 

服务的降级

 

如何创建注册中心

依赖包

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>

 

配置项

#注册中心端口号
server.port=7000
#应用程序名称
spring.application.name=spring-cloud-eureka
#注册中心的注册地址
eureka.client.service-url.defaultZone=http://localhost:7000/eureka/
#不把当前项目注册至注册中心
eureka.client.register-with-eureka=false

#开发环境关闭自我保存功能
eureka.server.enable-self-preservation=false

 

启动项目

@EnableEurekaServer

创建一个客户端程序,注册至服务中心

集群部署

服务网关

负载均衡

服务和服务之间互相调用

 

熔断机制

Hystrix

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/lin02/p/11521639.html