instance:# preferIpAddress: true prefer-ip-address: true metadata-map: cluster: MY_CLUSTER healthCheckUrlPath: ${management.contextPath}/health# statusPageUrlPath: ${management.contextPath}/info status-page-url-path: ${management.contextPath}/info
从上面可以看出,yml即支持用横线分隔也支持用驼峰命名的方法。
instance: preferIpAddress: true statusPageUrlPath: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.info.path:/info} healthCheckUrlPath: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.health.path:/health} metadata-map: management.context-path: ${server.context-path:${SERVER_CONTEXTPATH:}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}} management.port: ${management.port:${MANAGEMENT_PORT:${server.port:${SERVER_PORT:8080}}}}
# status-page-url: http://${eureka.instance.hostname:localhost}:${management.port:${MANAGEMENT_PORT:8088}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.info.path:/info}# health-check-url: http://${eureka.instance.hostname:localhost}:${management.port:${MANAGEMENT_PORT:8088}}${management.context-path:${MANAGEMENT_CONTEXTPATH:}}${endpoints.health.path:/health}
management: address: 193.0.30.201 contextPath: /admin port: ${MANAGEMENT_PORT:${server.port:${SERVER_PORT:8080}}}