I am using Eureka server - version 3.0.3 and have configured the datacenter and environment information using the below configuration:
eureka:
datacenter: Mumbai
environment: QA
server:
enable-self-preservation: false
instance:
lease-renewal-interval-in-seconds: 30
lease-expiration-duration-in-seconds: 90
client:
register-with-eureka: false
fetch-registry: false
I do not see the Datacenter and Environment information in the Eureka dashboard. In the older versions of Eureka, the information used to be displayed. Is there any change in the configuration with the current release?
Comment From: weixsun
Ok i have the same problem.
Comment From: OlgaMaciaszek
This was broken while removing Archaius.
Changed from:
model.put("environment",
ConfigurationManager.getDeploymentContext().getDeploymentEnvironment());
model.put("datacenter",
ConfigurationManager.getDeploymentContext().getDeploymentDatacenter());
to:
model.put("environment", "N/A");
model.put("datacenter", "N/A");
in EurekaController.
Comment From: user20161119
This was broken while removing Archaius.
Changed from:
model.put("environment", ConfigurationManager.getDeploymentContext().getDeploymentEnvironment()); model.put("datacenter", ConfigurationManager.getDeploymentContext().getDeploymentDatacenter());to:
model.put("environment", "N/A"); model.put("datacenter", "N/A");in
EurekaController.
what is the right way currently to set those values?
Comment From: weixsun
@user20161119
what is the right way currently to set those values?
Create a package named org.springframework.cloud.netflix.eureka.server and full copy EurekaController in your project.
Then the easiest way is to inject these two configuration items via @Value
public class EurekaController {
@Value("${eureka.environment:test}")
private String environment;
@Value("${eureka.datacenter:default}")
private String datacenter;
model.put("environment", environment);
model.put("datacenter", datacenter);