SpringCloud Greenwich(四)注册中心之eureka、Zuul和 gateway网关配置
本项目是搭建基于eureka注册中心的springcloud,使用zuul网关和gateway网关
一、框架搭建
(1)项目结构
eureka-server eureka注册中心
micro-service 服务提供者
zuul-gateway zuul网关
springcloud-gateway gateway网关
(2)环境
eureka-server 2.1.3
springboot 2.1.9
springcloud Greenwich
二、项目配置application.yaml
localhost:8180为本地eureka单点注册注册中心地址
(1)eureka-server
spring:application:name: eureka-serverprofiles:active: devjackson:time-zone: GMT+8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYScloud:config:enabled: falseeureka:server:#enableSelfPreservation: false #自我保存模式renewalPercentThreshold: 0 #续订阈值client:fetch-registry: falseregister-with-eureka: false
# service-url:
# defaultZone: http://localhost:${server.port}/eurekaserver:port: 8180
(2)micro-service
spring:application:name: micro-serviceprofiles:active: devjackson:time-zone: GMT+8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYSeureka:client:service-url:defaultZone: http://localhost:8180/eurekaserver:port: 8081
(3)zuul-gateway
spring:application:name: zuul-gatewayprofiles:active: devjackson:time-zone: GMT+8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYSeureka:client:service-url:defaultZone: http://localhost:8180/eurekaserver:port: 8082zuul:strip-prefix: true #转发路径截断匹配前缀
# prefix: "/api"add-proxy-headers: falseset-content-length: truesemaphore:max-semaphores: 600hystrix:command:default:execution:isolation:thread:timeoutInMilliseconds: 120000
ribbon:ReadTimeout: 240000ConnectTimeout: 2000MaxAutoRetries: 0MaxAutoRetriesNextServer: 1eager-load:enabled: trueclients: micro-service
(4)springcloud-gateway
spring:application:name: springcloud-gatewayprofiles:active: devjackson:time-zone: GMT+8date-format: yyyy-MM-dd HH:mm:ssdefault-property-inclusion: ALWAYScloud:gateway:discovery:locator:enabled: truelower-case-service-id: truehttpclient:connect-timeout: 60000response-timeout: 5sroutes:- id: micro-service1uri: lb://micro-servicepredicates:- Path=/micro-service1/**filters:- StripPrefix=1- id: micro-service3uri: lb://micro-servicepredicates:- Path=/micro-service3/**filters:- PrefixPath=/microeureka:client:service-url:defaultZone: http://localhost:8180/eurekaserver:port: 8083hystrix:command:default:execution:isolation:thread:timeoutInMilliseconds: 120000
ribbon:ReadTimeout: 240000ConnectTimeout: 2000MaxAutoRetries: 0MaxAutoRetriesNextServer: 1eager-load:enabled: trueclients: micro-service
三、项目地址
https://github.com/90duc/springcloud-eureka
SpringCloud Greenwich(四)注册中心之eureka、Zuul和 gateway网关配置相关推荐
- SpringCloud Greenwich(三)注册中心之zookeeper、Zuul和 gateway网关配置
本项目是搭建基于zookeeper注册中心的springcloud,使用zuul网关和gateway网关 一.框架搭建 (1)项目结构 micro-service 服务提供者 zuul-gatewa ...
- SpringCloud Greenwich(二)注册中心之consul、Zuul和 gateway网关配置
本项目是搭建基于consul注册中心的springcloud,使用zuul网关和gateway网关 一.框架搭建 (1)项目结构 micro-service 服务提供者 zuul-gateway ...
- SpringCloud Greenwich(一)注册中心之nacos、Zuul和 gateway网关配置
本项目是搭建基于nacos注册中心的springcloud,使用zuul网关和gateway网关. 一.框架搭建 (1)项目结构 micro-service 服务提供者 zuul-gateway ...
- SpringCloud简介及注册中心Eureka
一.SpringCloud简介 1.简介 Spring Cloud是一系列框架的有序集合.它利用Spring Boot的开发便利性巧妙地简化了分布式系统基 础设施的开发,如服务发现注册.配置中心.消息 ...
- springcloud(二):注册中心Eureka
Eureka是Netflix开源的一款提供服务注册和发现的产品,它提供了完整的Service Registry和Service Discovery实现.也是springcloud体系中最重要最核心的组 ...
- SpringCloud知识点梳理 - 1.服务注册中心组件--Eureka
提纲挈领 注册中心的作用:对各个微服务的管理.记录与监控. 1.核心概念 如下图,服务提供者和服务的消费者,本质上也是 Eureka Client 角色.整体上可以分为两个主体:Eureka Serv ...
- 服务注册中心:Eureka
目录 第一章 注册中心介绍 1.1.什么是注册中心 1.2.为啥用注册中心 1.3.常见的注册中心 第二章 Eureka介绍 2.1.Eureka的介绍 2.2.Eureka的三种角色 2.3.Eur ...
- SpringCloud 搭建服务注册中心
SpringCloud 搭建服务注册中心 原创 作者 | 于海东 之前在巧玩SpringBoot--SpringBoot的第一个"Hello World!"(https://blo ...
- 注册中心—组件—Eureka
原文作者:纯洁的微笑 原文地址:springcloud(二):注册中心Eureka 目录 一.单点 1.pom中添加依赖 2.启动代码中添加@EnableEurekaServer注解 3.配置文件 二 ...
最新文章
- Lambda中的常用sql方法
- Android与iOS:谁更适合HTML 5?
- pytorch 正向与反向传播的过程 获取模型的梯度(gradient),并绘制梯度的直方图
- golang 反射_Golang 会淘汰 Python 吗?
- 昇腾万里·让AI无所不及!DevRun开发者沙龙在武汉成功举办
- 任正非华为为什么暂不推出鸿蒙,任正非表示,华为的鸿蒙系统已经上网?惊喜吗...
- OpenCV-人像—酷感冷艳滤镜
- A - Silver Cow Party(最短路径+矩阵转换)
- Median of Two Sorted Array leetcode java
- Eclipse安装WindowsBuilder失败解决方法
- WebStorm和VSCode配置
- Server 2008 R2大改造变成梦幻Win7系统
- 从阿里云DATAV GeoAtlas接口抽取行政区划数据
- Python这些操作,逆天且实用
- 来给罗永浩和王自如打个分(上)
- Kali linux渗透测试系列————29、Kali linux 渗透攻击之无线网络攻击
- Project 2016中如何管理工时?
- 测试常用正则表达式整理汇总
- 【攻略】如何用云服务器实现云搬砖
- 压缩PDF文件的一个绝妙做法
热门文章
- 南湖量子计算机科学课程,《量子计算》暑期课程开课通知
- C++set容器-查找和统计
- 数据结构与算法--分治算法-最大子序列和问题
- 与php有区别_php://output和php://stdout的区别
- 数据结构---模式匹配
- Java ASM与Javassit
- 1575 Gcd and Lcm
- HDU - 7084 Pty loves string kmp + fail树 + 主席树
- 【ZJOI2019】线段树【线段树上dp】【大讨论】
- 【BJOI2017】树的难题【点分治】【线段树】