适配eureka

This commit is contained in:
tanghc
2019-09-27 20:06:52 +08:00
parent be0adc0a8e
commit 35253be77d
40 changed files with 751 additions and 294 deletions

View File

@@ -0,0 +1,47 @@
# 使用eureka
## 修改网关
- 打开`/sop-gateway/pom.xml`
添加依赖:
```xml
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
```
- 打开sop-gateway下`application-dev.properties`
注释nacos配置
```properties
# nacos cloud配置
#spring.cloud.nacos.discovery.server-addr=${nacos.url}
#nacos.config.server-addr=${nacos.url}
```
添加eureka配置
```properties
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
```
## 微服务端修改
步骤同上
## admin修改
打开`application-dev.properties`,新增配置
```properties
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
# 如果使用eureka填eureka使用nacos填eureka
registry.name=eureka
```