mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
适配eureka
This commit is contained in:
@@ -59,15 +59,10 @@
|
||||
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 使用nacos注册中心
|
||||
版本 0.2.x.RELEASE 对应的是 Spring Boot 2.x 版本,版本 0.1.x.RELEASE 对应的是 Spring Boot 1.x 版本。
|
||||
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-alibaba-nacos-discovery
|
||||
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
@@ -78,19 +73,18 @@
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos-client.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
<!-- 注册中心end -->
|
||||
|
||||
<!--
|
||||
这里依赖springboot版本,非cloud版本。
|
||||
如果依赖了spring-cloud-starter-alibaba-nacos-config,需要额外配置一个bootstrap.properties
|
||||
|
||||
-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.boot</groupId>
|
||||
<artifactId>nacos-config-spring-boot-starter</artifactId>
|
||||
<version>${nacos-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
-->
|
||||
|
||||
|
||||
<!-- test -->
|
||||
<dependency>
|
||||
|
@@ -18,9 +18,6 @@ zipkin.url=http://127.0.0.1:9411/
|
||||
pre.domain=localhost
|
||||
# ------- 需要改的配置end -------
|
||||
|
||||
# eureka注册中心
|
||||
eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
|
||||
|
||||
# 入口地址,不用改,默认是/zuul
|
||||
zuul.servlet-path=/api
|
||||
# 禁用默认的过滤器,不能删,不用改
|
||||
@@ -40,8 +37,8 @@ ribbon.ReadTimeout=2000
|
||||
ribbon.OkToRetryOnAllOperations=false
|
||||
|
||||
# nacos cloud配置
|
||||
#spring.cloud.nacos.discovery.server-addr=${nacos.url}
|
||||
#nacos.config.server-addr=${nacos.url}
|
||||
spring.cloud.nacos.discovery.server-addr=${nacos.url}
|
||||
nacos.config.server-addr=${nacos.url}
|
||||
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://${mysql.host}/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
|
||||
|
Reference in New Issue
Block a user