springcloud

编程知识 行业动态 更新时间:2024-06-13 00:22:06

1. 微服务

:就是把一个单体项目,拆分为多个微服务,每个微服务可以独立技术选型,独立开发,独立部署,独立运维.并且多个服务相互协调,相互配合,最终完成用户的价值.
https://github/Netflix/eureka

2. 五大重要组件

服务发现——Netflix Eureka
客服端负载均衡——Netflix Ribbon/Feign
服务网关——Netflix Zuul
断路器——Netflix Hystrix
分布式配置——Spring Cloud Config

3. Spring cloud搭建环境

Spring cloud-Eureka注册中心

org.springframework.cloud spring-cloud-starter-netflix-eureka-server

4.注解

@SpringBootApplication
@EnableEurekaServer//标识是eureka服务端
public class SpringCloudEurekaServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringCloudEurekaServerApplication.class);
}
}
spring.application.name=spring-cloud-eureka-server
server.port=1024
eureka.client.service-url.defaultZone=http://localhost:8762/eureka
#eureka不注册
eureka.client.register-with-eureka=false
#不获取eureka的服务地址
eureka.client.fetch-registry=false

5.启动入库类访问localhost:1024

更多推荐

springcloud

本文发布于:2023-04-01 18:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/a35a78f57fb82b1afd043d4acf332256.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:springcloud

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!