feat(负载均衡): 引入负载均衡

This commit is contained in:
Bunny 2025-02-09 18:15:30 +08:00
parent 3d6b6cb95f
commit 6f5327117c
6 changed files with 36 additions and 5 deletions

View File

@ -39,6 +39,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2023.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -0,0 +1,7 @@
spring:
cloud:
nacos:
server-addr: 192.168.3.132
config:
import-check:
enabled: false

View File

@ -4,7 +4,6 @@ server:
spring:
application:
name: cloud-demo1
cloud:
nacos:
server-addr: 192.168.3.132
profiles:
include:
- cloud

View File

@ -0,0 +1,7 @@
spring:
cloud:
nacos:
server-addr: 192.168.3.132
config:
import-check:
enabled: false

View File

@ -3,7 +3,12 @@ server:
spring:
application:
name: cloud-demo2
profiles:
include:
- cloud
cloud:
nacos:
server-addr: 192.168.3.132
config:
import-check:
enabled: false

View File

@ -61,9 +61,15 @@
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- nacos-config -->
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
<!-- loadbalancer -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
</dependencies>
</project>