Я создал два сервера Eureka как основной и дополнительный.Я настроил свой сервисный URL в сервисах Micro bootstrap.yml, как показано ниже.
spring:
application:
name: ilpproxy
# Discovery Server Access
eureka:
client:
serviceUrl:
defaultZone: http://10.83.134.39:8761/eureka/,http://10.83.143.221:8761/eureka/
cloud:
config:
uri: ${vcap.services.${PREFIX:}configserver.credentials.uri:http://user:password@localhost:8888}
Мой сервис зарегистрирован только на первичном Eureka и не указан на вторичном.Если я сконфигурировал первичную Eureka в качестве первого значения, то служба будет указана в обоих экземплярах Eureka.
Ниже application.yml Eureka
server:
port: 8761
security:
user:
password: ${eureka.password} # Don't use a default password in a real app
info:
component: Discovery Server
logging:
level:
root: WARN
com.pearson: WARN
com.netflix.hystrix: WARN
file: /data/logs/eureka.log
eureka:
client:
registerWithEureka: false
fetchRegistry: false
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
server:
waitTimeInMsWhenSyncEmpty: 0
enableSelfPreservation: false
password: ${SECURITY_USER_PASSWORD:password}
instance:
hostname: 127.0.0.1
---
spring:
profiles: peer # not standalone
eureka:
instance:
hostname: 127.0.0.1
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://user:${eureka.password}@127.0.0.1:8761/eureka/
---
spring:
profiles: other # not standalone
server:
port: 8762
eureka:
instance:
hostname: 127.0.0.1
nonSecurePort: ${server.port}
client:
serviceUrl:
defaultZone: http://user:${eureka.password}@127.0.1.1:8761/eureka/
---
spring:
profiles: local # connect to remote peer
eureka:
instance:
hostname: ${localhost.hostname:${localhost.ngrok}.ngrok.com}
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://user:${eureka.password}@${PREFIX:}eureka.cfapps.io/eureka/
---
spring:
profiles: zone_d # connect to remote peer
server:
port: 8761
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://10.83.143.221:8761/eureka/,http://10.83.134.39:8761/eureka/
server:
waitTimeInMsWhenSyncEmpty: 0
password: ${SECURITY_USER_PASSWORD:password}
logging:
level:
root: WARN
com.pearson: WARN
com.netflix.hystrix: WARN
file: /data/logs/eureka.log
Пожалуйста, помогите решить эту проблему.