注册中心:
debug: true spring: application: name: eureka-server logging: level: com.netflix.eureka: ‘off‘ com.netflix.discovery: ‘off‘ --- spring: profiles: manager1 server: port: 8100 eureka: instance: prefer-ip-address: true #以IP地址注册到服务中心,相互注册使用IP地址 #ip-address: 192.168.1.1 #强制指定IP地址,默认会获取本机的IP地址 client: service-url: defaultZone: http://192.168.1.2:8100/eureka/,http://192.168.1.3:8100/eureka/ --- spring: profiles: manager2 server: port: 8100 eureka: instance: prefer-ip-address: true client: service-url: defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.3:8100/eureka/ --- spring: profiles: manager3 server: port: 8100 eureka: instance: prefer-ip-address: true client: service-url: defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.2:8100/eureka/
微服务端:
debug: true spring: application: name: eureka-client server: port: 8110 eureka: instance: prefer-ip-address: true #以IP地址注册到服务中心 #instance-id: http://192.168.1.4:8110 #服务中心的信息显示(如果IP地址不显示的话,进行配置) client: service-url: defaultZone: http://192.168.1.1:8100/eureka/,http://192.168.1.2:8100/eureka/,http://192.168.1.3:8100/eureka/
原文地址:https://www.cnblogs.com/tianciliangen/p/11650060.html
时间: 2024-10-07 12:37:19