mirror of
https://gitee.com/yudaocode/SpringBoot-Labs.git
synced 2026-09-03 05:53:54 +08:00
增加 Consul 入门
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
spring:
|
||||
application:
|
||||
name: demo-consumer # Spring 应用名
|
||||
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: 127.0.0.1:2181
|
||||
# Zookeeper 作为注册中心的配置项,对应 ZookeeperDiscoveryProperties 配置类
|
||||
# Spring Cloud Consul 通用配置项,对应 ConsulProperties 类
|
||||
consul:
|
||||
host: 127.0.0.1 # Consul 主机
|
||||
port: 8500 # Consul 端口
|
||||
# Spring Cloud Consul Discovery 配置项,对应 ConsulDiscoveryProperties 类
|
||||
discovery:
|
||||
root: /services # Zookeeper 数据存储的根节点,默认为 /services
|
||||
service-name: ${spring.application.name} # 注册到 Consul 的服务名,默认为 `spring.application.name` 配置项
|
||||
health-check-path: /actuator/health # 健康检查的接口,默认为 /actuator/health,由 Spring Boot Actuator 提供
|
||||
|
||||
server:
|
||||
port: 28080 # 服务器端口。默认为 8080
|
||||
|
||||
@@ -9,6 +9,7 @@ spring:
|
||||
# Spring Cloud Consul Discovery 配置项,对应 ConsulDiscoveryProperties 类
|
||||
discovery:
|
||||
service-name: ${spring.application.name} # 注册到 Consul 的服务名,默认为 `spring.application.name` 配置项
|
||||
health-check-path: /actuator/health # 健康检查的接口,默认为 /actuator/health,由 Spring Boot Actuator 提供
|
||||
|
||||
server:
|
||||
port: 18080 # 服务器端口。默认为 8080
|
||||
|
||||
1
labx-27/《芋道 Spring Cloud 注册中心 Consul 入门》.md
Normal file
1
labx-27/《芋道 Spring Cloud 注册中心 Consul 入门》.md
Normal file
@@ -0,0 +1 @@
|
||||
<http://www.iocoder.cn/Spring-Cloud/Consul-Discovery/?github>
|
||||
Reference in New Issue
Block a user