eureka注册中心 yml配置
server: port: 10086 # 端口 spring: application: name: eureka-server # 应用名称,会在Eureka中显示 eureka: instance: ip-address: 192.168.8. hostname: localhost instance-id: ${eureka.instance.ip-address}:${spring.application.name}:${server.port} client: service-url: # EurekaServer的地址,现在是自己的地址,如果是集群,需要加上其它Server的地址。 defaultZone: http://localhost:${server.port}/eureka
其他服务或者消费端配置
eureka: instance: ip-address: 192.168.8.116 hostname: localhost prefer-ip-address: true instance-id: ${eureka.instance.ip-address}:${spring.application.name}:${server.port} client: service-url: # EurekaServer地址 defaultZone: http://localhost:10086/eureka