在application.properties中内容是这样的:spring
server.port=8801 eureka.client.register-with-eureka=false eureka.client.fetch-registry=false eureka.client.serviceUrl.defaultZone=http\://localhost\:${server.port}/eureka/
**可是发如今官网或者其余的开源项目中,大可能是使用.yml文件配置的。将yml与properties对比以后发现,yml最大的好处在于其拥有自然的树状结构,因此着手尝试将properties文件更改成yml文件,发现了几个要注意的地方: **json
server: port: 8801 eureka: client: registerWithEureka: false fetchRegistry: false serviceUrl: defaultZone: http://localhost:8801/eureka/