一、Spring Cloud Eureka
基于Netflix Eureka做了二次封装
由两个组件组成
Eureka Server 注册中心, 供服务注册的服务器
Eureka Client 服务注册。 用于简化与服务器的交互
二、注册中心
Eureka Server
记录了所有应用的信息和状态
三、创建工程
下一步
下一步
然后在类EurekaApplication中增加EnableEurekaServer注解
创建好了之后,启动应用
但是不停的报如下错误
com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
解决方法:创建application.yml文件,增加如下图的配置
2、打开localhost:8080
因为该应用程序是注册中心,不应该出现在Instances currently registered with Eureka中
所有增加配置
3、修改端口
因为Java很多默认的端口是8080,为了便于管理,将端口改成默认端口8761