eureka-Server注册中心所需要的pom文件:
<!--导入Eureka Server依赖-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>
<!--热部署工具-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>
eureka-server注册中心所需要的相关配置文件:
# Eureka配置
eureka:
instance:
# Eureka服务端的实例名字
hostname: 127.0.0.1
client:
# 表示是否向 Eureka 注册中心注册自己(这个模块本身是服务器,所以不需要)
register-with-eureka: false
# fetch-registry如果为false,则表示自己为注册中心,客户端的化为 ture
fetch-registry: false
# Eureka监控页面~
service-url:
defaultZone: http://192.168.1.12:8761/eureka/
eureka-client 客户端pom文件
<!--Eureka依赖-->
<!-- https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka</artifactId>
<version>1.4.6.RELEASE</version>
</dependency>
eureka-client 客户端配置文件:
#eureka 注册地址
eureka:
client:
service-url:
defaultZone: http://127.0.0.1:8761/eureka/
instance:
instance-id: qwewe #修改Eureka上的默认描述信息