update
This commit is contained in:
parent
e60ad1ad74
commit
4ed6abf4ea
@ -1,20 +1,22 @@
|
||||
# Eureka+Zuul+Feign+Hystrix构建微服务架构
|
||||
|
||||
最近研究了微服务,搭建了高可用的demo。
|
||||
注:本文参考了https://github.com/forezp/SpringCloudLearning, 如有侵权,请告知笔者。
|
||||
|
||||
## 首先介绍下微服务
|
||||
微服务最早由Martin Fowler与James Lewis于2014年共同提出,微服务架构风格是一种使用一套小服务来开发单个应用的方式途径,每个服务运行在自己的进程中,并使用轻量级机制通信,通常是HTTP API,这些服务基于业务能力构建,并能够通过自动化部署机制来独立部署,这些服务使用不同的编程语言实现,以及不同数据存储技术,并保持最低限度的集中式管理
|
||||
可以不错的科普文章: https://blog.csdn.net/wuxiaobingandbob/article/details/78642020?locationNum=1&fps=1
|
||||
微服务最早由Martin Fowler与James Lewis于2014年共同提出,微服务架构风格是一种使用一套小服务来开发单个应用的方式途径,每个服务运行在自己的进程中,并使用轻量级机制通信,通常是HTTP API,这些服务基于业务能力构建,并能够通过自动化部署机制来独立部署,这些服务使用不同的编程语言实现,以及不同数据存储技术,并保持最低限度的集中式管理
|
||||
可以不错的科普文章: https://blog.csdn.net/wuxiaobingandbob/article/details/78642020?locationNum=1&fps=1
|
||||
|
||||
## 微服务解决的问题:
|
||||
微服务架构模式(Microservices Architecture Pattern)的目的是将大型的、复杂的、长期运行的应用程序构建为一组相互配合的服务,每个服务都可以很容易得局部改良
|
||||
这里有一个图非常好的总结微服务架构需要考虑的问题,包括
|
||||
1)API Gateway
|
||||
2)服务间调用
|
||||
3)服务发现
|
||||
4)服务容错
|
||||
5)服务部署
|
||||
6)数据调用
|
||||
|
||||
微服务架构模式(Microservices Architecture Pattern)的目的是将大型的、复杂的、长期运行的应用程序构建为一组相互配合的服务,每个服务都可以很容易得局部改良
|
||||
这里有一个图非常好的总结微服务架构需要考虑的问题,包括
|
||||
1)API Gateway
|
||||
2)服务间调用
|
||||
3)服务发现
|
||||
4)服务容错
|
||||
5)服务部署
|
||||
6)数据调用
|
||||
|
||||
## Spring-cloud,微服务框架
|
||||
Spring Cloud Netflix provides Netflix OSS integrations for Spring Boot apps through autoconfiguration and binding to the Spring Environment and other Spring programming model idioms. With a few simple annotations you can quickly enable and configure the common patterns inside your application and build large distributed systems with battle-tested Netflix components. The patterns provided include Service Discovery (Eureka), Circuit Breaker (Hystrix), Intelligent Routing (Zuul) and Client Side Load Balancing (Ribbon)..
|
||||
@ -30,6 +32,7 @@
|
||||
![demo](https://github.com/lonefeifei/SpringCloudLearning/blob/master/chapter15/demo1.png)
|
||||
|
||||
说明:
|
||||
|
||||
1.每个服务均为单点,无法满足高可用
|
||||
|
||||
2.代码可参考:https://github.com/lonefeifei/SpringCloudLearning/tree/master/chapter5
|
||||
@ -39,6 +42,7 @@
|
||||
![demo](https://github.com/lonefeifei/SpringCloudLearning/blob/master/chapter15/demo2.png)
|
||||
|
||||
说明:
|
||||
|
||||
0.架构中, 服务网关作为入口,统一对外提供服务;业务层,实现业务需求,通过feign与数据层交互,并通过hystrix进行过载保护,ribbon进行负载均衡;数据层作为数据服务通过http对外提供服务;
|
||||
|
||||
1.各服务均为集群部署模式
|
||||
@ -92,7 +96,7 @@ eureka:
|
||||
```
|
||||
4.业务层:实现业务需求,通过feign与数据层交互,并通过hystrix进行过载保护,ribbon进行负载均衡, 部署多个实例即可,在配置eureka服务端时,将2中两个eureka实例增多添加上即可。
|
||||
|
||||
5. 服务网关作为入口,统一对外提供服务,部署多个实例,在配置eureka服务端时,将2中两个eureka实例增多添加上即可。
|
||||
5.服务网关作为入口,统一对外提供服务,部署多个实例,在配置eureka服务端时,将2中两个eureka实例增多添加上即可。
|
||||
|
||||
6.nginx作为代理,可在不同网关实例中进行负载均衡(本文未实现)。
|
||||
|
||||
@ -156,8 +160,7 @@ java -jar service-zuul-0.0.1-SNAPSHOT.jar --server.port=8769
|
||||
architectural term:https://martinfowler.com/articles/microservices.html
|
||||
|
||||
微服务架构(一):什么是微服务
|
||||
https://blog.csdn.net/fly_zhyu/article/details/
|
||||
76408158
|
||||
https://blog.csdn.net/fly_zhyu/article/details/76408158
|
||||
|
||||
微服务技术调研与实践
|
||||
https://www.jianshu.com/p/0c29ebffced3
|
||||
|
Loading…
Reference in New Issue
Block a user