从零开始搭建spring-cloud(0) --springboot与springcloud的关系

Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems (e.g. configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state). Coordination of distributed systems leads to boiler plate patterns, and using Spring Cloud developers can quickly stand up services and applications that implement those patterns. They will work well in any distributed environment, including the developer’s own laptop, bare metal data centres, and managed platforms such as Cloud Foundry.
Spring Cloud为开发人员提供了快速构建分布式系统中一些常见的组件(例如配置管理,服务发现,断路器,智能路由,微代理,控制总线,一次性tokens,全局锁,选举,分布式session,集群监测)。各个组件之间能够很好的衔接, 使用Spring Cloud开发人员能够快速地支持实现这些组件服务和应用程序。他们将在任何分布式环境中均可以很好地运行,即便在开发人员本身的笔记本电脑,零配置的数据中心,以及Cloud Foundry等托管平台。java

 Features 特性

Spring Cloud 更专一于提升组件"开箱即用"的体验,提供良好的扩展机制。git

  • Distributed/versioned configuration  分布式/版本化配置spring

  • Service registration and discovery 服务注册和发现数据库

  • Routing 路由后端

  • Service-to-service calls 服务和服务之间的调用网络

  • Load balancing 负载均衡session

  • Circuit Breakers 断路由架构

  • Global locks 全局锁app

  • Leadership election and cluster state 领导选举和集群状态负载均衡

  • Distributed messaging 分布式消息传递

 Spring Cloud采用了一种很是声明性的方法,一般只需更改classpath或annotation就能够使用不少特性。例以下面的一个discovery 客户端:

@SpringBootApplication
@EnableDiscoveryClient
public class Application {
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}

Main Projects 重要项目

Spring Cloud Config


    Centralized external configuration management backed by a git repository. The configuration resources map directly to Spring Environment but could be used by non-Spring applications if desired.

    配置中心,利用git集中管理程序的配置。 配置资源能够直接映射到Spring环境中去,也能够根据须要映射到其余非Spring应用上。

Spring Cloud Netflix    

Integration with various Netflix OSS components (Eureka, Hystrix, Zuul, Archaius, etc.).

与其余Netflix组件(Eureka, Hystrix, Zuul, Archaius等等)集成。

Spring Cloud Bus

An event bus for linking services and service instances together with distributed messaging. Useful for propagating state changes across a cluster (e.g. config change events).
     消息总线,利用分布式消息将服务和服务实例链接在一块儿,用于在一个集群中传播状态的变化 

Spring Cloud Cloudfoundry

    Integrates your application with Pivotal Cloud Foundry. Provides a service discovery implementation and also makes it easy to implement SSO and OAuth2 protected resources.
    利用Pivotal Cloud Foundry集成本身的应用,提供了服务发现,而且使SSO和OAuth2的实现更加简单。Spring Cloud for Cloudfoundry能够轻松地在Cloud Foundry(平台即服务)中运行Spring Cloud应用程序。 Cloud Foundry具备“服务”的概念,即“绑定”到应用程序的中间件,实质上为其提供包含凭据的环境变量(例如,用于服务的位置和用户名)。

Spring Cloud Open Service Broker

    Provides a starting point for building a service broker that implements the Open Service Broker API.
    Spring Cloud Open Service Broker是一个用于构建实现Open Service Broker API的Spring Boot应用程序的框架。(为创建管理云托管服务的服务代理提供了一个起点。)

Spring Cloud Cluster

Leadership election and common stateful patterns with an abstraction and implementation for Zookeeper, Redis, Hazelcast, Consul.
    提供Leadership选举,如:Zookeeper, Redis, Hazelcast, Consul等常见状态模式的抽象和实现。(基于Zookeeper, Redis, Hazelcast, Consul实现的领导选举和平民状态模式的抽象和实现)

Spring Cloud Consul

    Service discovery and configuration management with Hashicorp Consul.
    Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置。(基于Hashicorp Consul实现的服务发现和配置管理)

Spring Cloud Security

    Provides support for load-balanced OAuth2 rest client and authentication header relays in a Zuul proxy.
    在Zuul代理中为OAuth2 rest客户端和认证头转发提供负载均衡。

Spring Cloud Sleuth

    Distributed tracing for Spring Cloud applications, compatible with Zipkin, HTrace and log-based (e.g. ELK) tracing.
    分布式Spring Cloud Application服务链路追踪,兼容Zipkin,HTrace 和log-based(例如ELK)。

Spring Cloud Data Flow

    A cloud-native orchestration service for composable microservice applications on modern runtimes. Easy-to-use DSL, drag-and-drop GUI, and REST-APIs together simplifies the overall orchestration of microservice based data pipelines.
    一个云本地程序和操做模型,组成数据微服务在一个结构化的平台上。管道由Spring Boot应用程序组成,使用Spring Cloud Stream或Spring Cloud Task微服务框架构建。 这使得Spring Cloud Data Flow适用于各类数据处理用例,从导入/导出到事件流和预测分析。

Spring Cloud Stream

    A lightweight event-driven microservices framework to quickly build applications that can connect to external systems. Simple declarative model to send and receive messages using Apache Kafka or RabbitMQ between Spring Boot apps.
    基于Redis,Rabbit,Kafka实现的消息微服务,简单声明模型用以在Spring Cloud应用中收发消息。

Spring Cloud Stream App Starters

    Spring Cloud Stream App Starters are Spring Boot based Spring Integration applications that provide integration with external systems.
     基于Spring Boot为外部系统提供spring的集成

Spring Cloud Task

    A short-lived microservices framework to quickly build applications that perform finite amounts of data processing. Simple declarative for adding both functional and non-functional features to Spring Boot apps.
    Spring Cloud Task的目标是为Spring Boot应用程序提供建立短运行期微服务的功能。在Spring Cloud Task中,咱们能够灵活地动态运行任何任务,按需分配资源并在任务完成后检索结果。Tasks是Spring Cloud Data Flow中的一个基础项目,容许用户将几乎任何Spring Boot应用程序做为一个短时间任务执行。(短生命周期的微服务,为SpringBooot应用简单声明添加功能和非功能特性。)

Spring Cloud Task App Starters

    Spring Cloud Task App Starters are Spring Boot applications that may be any process including Spring Batch jobs that do not run forever, and they end/stop after a finite period of data processing.

Spring Cloud Zookeeper

    Service discovery and configuration management with Apache Zookeeper.
    使用Apache Zookeeper做为服务发现和配置管理

Spring Cloud AWS

    Easy integration with hosted Amazon Web Services. It offers a convenient way to interact with AWS provided services using well-known Spring idioms and APIs, such as the messaging or caching API. Developers can build their application around the hosted services without having to care about infrastructure or maintenance.
    快速和亚马逊网络服务集成。提供一个便捷的方式与AWS提供的服务进行交互,而开发者不须要关心他的设计与维护。

Spring Cloud Connectors

    Makes it easy for PaaS applications in a variety of platforms to connect to backend services like databases and message brokers (the project formerly known as "Spring Cloud").
    便于PaaS应用在各类平台上链接到后端像数据库和消息经纪服务。

Spring Cloud Starters

    Spring Boot-style starter projects to ease dependency management for consumers of Spring Cloud. (Discontinued as a project and merged with the other projects after Angel.SR2.)
    Spring Boot-style starter项目,以简化Spring Cloud用户的依赖项管理。(项目已经终止而且在Angel.SR2后的版本和其余项目合并)

Spring Cloud CLI

    Spring Boot CLI plugin for creating Spring Cloud component applications quickly in Groovy
    使用Groovy快速搭建Spring Cloud组件。

Spring Cloud Contract

    Spring Cloud Contract is an umbrella project holding solutions that help users in successfully implementing the Consumer Driven Contracts approach.
    一旦服务和服务之间定义了契约,Spring cloud contract会为服务消费端提供stub的mock server,这样,用户就能够只关注本身的服务进行测试,同时也不须要写大量的集成测试。

Spring Cloud Gateway

    Spring Cloud Gateway is an intelligent and programmable router based on Project Reactor.
    Spring Cloud Gateway是Spring Cloud官方推出的第二代网关框架,取代Zuul网关。网关做为流量的,在微服务系统中有着很是做用,网关常见的功能有路由转发、权限校验、限流控制等做用。

Spring Cloud OpenFeign

Spring Cloud OpenFeign provides integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms.    
    做为Spring Cloud的子项目之一,Spring Cloud OpenFeign以将OpenFeign集成到Spring Boot应用中的方式,为微服务架构下服务之间的调用提供了解决方案。首先,利用了OpenFeign的声明式方式定义Web服务客户端;其次还更进一步,经过集成Ribbon或Eureka实现负载均衡的HTTP客户端。

Spring Cloud Pipelines

    Spring Cloud Pipelines provides an opinionated deployment pipeline with steps to ensure that your application can be deployed in zero downtime fashion and easilly rolled back of something goes wrong.

Spring Cloud Function

 Spring Cloud Function promotes the implementation of business logic via functions. It supports a uniform programming model across serverless providers, as well as the ability to run standalone (locally or in a PaaS).

 Release Trains

Spring Cloud is an umbrella project consisting of independent projects with, in principle, different release cadences. To manage the portfolio a BOM (Bill of Materials) is published with a curated set of dependencies on the individual project (see below). The release trains have names, not versions, to avoid confusion with the sub-projects. The names are an alphabetic sequence (so you can sort them chronologically) with names of London Tube stations ("Angel" is the first release, "Brixton" is the second). When point releases of the individual projects accumulate to a critical mass, or if there is a critical bug in one of them that needs to be available to everyone, the release train will push out "service releases" with names ending ".SRX", where "X" is a number.

Spring Cloud是一个大型工程项目,由一些列独立的项目组成,在原则上具备不一样的发布节奏。为了管理组合,发布了一个BOM(版本清单),其中包含一组对单个项目的依赖关系(见下面)。为了不与子项目混淆,发布软件版本串有名称,而没有版本。这些名字是按字母顺序排列的(因此你能够按时间顺序排列),还有伦敦地铁站的名字(“Angel”是第一个版本,“Brixton”是第二个版本)。当单个项目的发布点累积到一个临界量时,或者若是其中有一个临界bug须要对全部人可用,那么发布序列将推出名称以“service release”,以“.SRX”结尾。,其中“X”是一个数字。

 

Table 1. Release train Spring Boot compatibility

Release Train Boot Version

Greenwich

2.1.x

Finchley

2.0.x

Edgware

1.5.x

Dalston

1.5.x