Spring Cloud
大气的名字
这个作者很懒,什么都没留下…
展开
-
第一篇:微服务构建——Spring Boot
1、构建Spring Cloud的基础框架是Spring Boot 也可以从这里下载生成好的 ,Spring Boot版本是1.5.17: https://download.csdn.net/download/china574512989/107307242、访问https://start.spring.io/可以快速构建Spring Boot,如图:点击 Generate...原创 2018-10-18 22:22:11 · 162 阅读 · 0 评论 -
第二篇:微服务构建——Spring Boot 多环境配置
1、在resource中创建如图文件:2、可以在application.properties中指定当前环境加载哪个配置文件#加载对应环境的配置 ,默认加载devspring.profiles.active=test3、可以在dev和test文件中指定当前环境特定的属性如test文件中:server.port=8009spring.application.name=s...原创 2018-10-18 22:34:40 · 320 阅读 · 0 评论 -
第三篇:服务治理:Spring Cloud Eureka
1、服务治理是微服务框架中的核心与基础,主要用来实现各个微服务实例的自动化注册和发现。 分为服务注册和服务发现。2、引入相应依赖模块<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-pare...原创 2018-10-23 11:47:31 · 166 阅读 · 0 评论 -
第三篇:服务治理:Spring Cloud Eureka——需要了解的知识
1、按照书本继续搬砖,我发现引入Spring Cloud Eureka后,系统启动时总是报一切莫名其妙的错误,不是说这个类找不到,就是那个方法没有。一头雾水。。。。。。。D:\ideaWorkeSpace\javaSE1.8\jdk1.8\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=a...原创 2018-10-23 11:27:20 · 3756 阅读 · 0 评论 -
第四篇:服务治理:Spring Cloud Eureka——注册服务提供者
1、新建一个项目:hello-service注意版本信息是否正确。2、引入相应依赖3、创建controllerpackage com.example.helloservice.web;import org.apache.log4j.Logger;import org.springframework.beans.factory.annotation.Autowired;im...原创 2018-10-23 13:44:28 · 109 阅读 · 0 评论 -
学习Spring Cloud中发现的问题(一)
EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE.启动两个client,过了一会,停...转载 2018-10-23 13:48:10 · 217 阅读 · 0 评论 -
学习Spring Cloud中发现的问题(二)
服务中心一直在报这个错,但我并没有用到8761端口2018-10-23 13:53:51.795 INFO 6600 --- [a-EvictionTimer] c.n.e.registry.AbstractInstanceRegistry : Running the evict task with compensationTime 0ms2018-10-23 13:53:57.60...原创 2018-10-23 14:34:23 · 6342 阅读 · 0 评论 -
第五篇:服务治理:Spring Cloud Eureka——高可用的注册中心
Eureka Server的高可用实际上就是将自己作为服务想其他服务注册中心注册自己,这样就可以形成一组相互注册的服务注册中心,以实现服务清单的互相同步,达到高可用的效果。1、创建application-peer1.properties,作为peer1服务中心的配置,并将serviceUrl指向peer2:server.port=8081spring.application.name=...原创 2018-10-23 17:06:47 · 104 阅读 · 0 评论