@TOC
spring cloud consul简单配置
spring:
cloud:
consul:
host: 192.168.37.204
port: 8500
servic-name: ${spring.application.name}
discovery:
prefer-ip-address: true #这个必须配,使用ip注册服务名字,默认为hostname
heartbeat:
enabled: true
在使用了下面的依赖时,配置需要写在bootstrap.yml文件里
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-config</artifactId>
</dependency>