This commit is contained in:
tanghc
2021-04-08 17:40:24 +08:00
parent 3804bf33a7
commit 9c3bafdd92
4 changed files with 2 additions and 54 deletions

View File

@@ -1,53 +1,3 @@
# 使用eureka
## 修改网关
- 打开`/sop-gateway/pom.xml`
注释nacos相关依赖
添加eureka依赖
```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=${register.url}
#nacos.config.server-addr=${register.url}
```
添加eureka配置
```properties
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
```
## 微服务端修改
步骤同上
## admin修改
打开`application-dev.properties`,新增配置
```properties
# 网关地址,多个用逗号隔开
# 在不使用nacos时有用使用nacos时注释掉
gateway.host=127.0.0.1:8081
# eureka注册中心
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
# 如果使用eureka填eureka使用nacos填nacos
registry.name=eureka
```
切换到`eureka`分支