I am trying to create a 3 node eureka cluster. Each peer is unsuccessfully register to one another because of the read time out issue. I noticed that when I set securePortEnabled to false and nonSecuredPortEnabled to true and remove statusPageUrl, healthCheckUrl and homePageUrl settings. Peers is able to register but not consistently, peer3 can register to both peer3 and peer2 but peer1 can't register on peer3. Also when I clicked on the instance id port 8080 is getting appended in the url before the path. In local everything is working not sure why it is not working when deployed in Pivotal Cloud Foundry.
this is the application.yml setup that is not working: java version: 11 spring boot version: 2.7.1 spring cloud version: 2021.0.3
app:
environment: ${APP_ENV:Dev}
# App static info
info:
application:
name: DiscoveryService
version: 2.0.0
spring:
application:
name: ${info.application.name}
profiles:
active: ${app.environment}
eureka:
datacenter: ${DS_DATACENTER:LOCAL}
environment: ${DS_ENVIRONMENT:LOCAL DEVELOPMENT}
server:
# Self Preservation is turned off since service and DS are in same data-center. Default is true
enableSelfPreservation: true
# Default is 0.85
renewalPercentThreshold: 0.85
instance:
nonSecurePort: 80
nonSecurePortEnabled: false
securePort: 443
securePortEnabled: true
statusPageUrl: https://${eureka.hostname}/actuator/info
healthCheckUrl: https://${eureka.hostname}/actuator/health
secureHealthCheckUrl: https://${eureka.hostname}/actuator/health
homePageUrl: https://${eureka.hostname}/
metadataMap:
management.port: 443
# Actuator config
management:
endpoints:
web:
exposure:
include: '*'
endpoint:
health:
show-details: always
shutdown:
enabled: true
startup:
enabled: true
info:
env:
enabled: true
java:
enabled: true
---
spring:
config:
activate:
on-profile: Peer1
application:
name: ${info.application.name}-Cluster
server:
port: ${PORT:8762}
eureka:
instance:
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
hostname: ${vcap.application.uris[0]}
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: ${PEER2_HOST}/eureka/,${PEER3_HOST}/eureka/
---
spring:
config:
activate:
on-profile: Peer2
application:
name: ${info.application.name}-Cluster
server:
port: ${PORT:8763}
eureka:
instance:
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
hostname: ${vcap.application.uris[0]}
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: ${PEER1_HOST}/eureka/,${PEER3_HOST}/eureka/
---
spring:
config:
activate:
on-profile: Peer3
application:
name: ${info.application.name}-Cluster
server:
port: ${PORT:8764}
eureka:
instance:
instanceId: ${spring.application.name}:${vcap.application.instance_id:${spring.application.instance_id:${random.value}}}
hostname: ${vcap.application.uris[0]}
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: ${PEER1_HOST}/eureka/,${PEER2_HOST}/eureka/
The kinda working setup:
...
eureka:
datacenter: ${DS_DATACENTER:LOCAL}
environment: ${DS_ENVIRONMENT:LOCAL DEVELOPMENT}
server:
# Self Preservation is turned off since service and DS are in same data-center. Default is true
enableSelfPreservation: true
# Default is 0.85
renewalPercentThreshold: 0.85
instance:
nonSecurePort: 80
nonSecurePortEnabled: true
securePort: 443
securePortEnabled: false
metadataMap:
management.port: 443
...