Spring-boot eureka.datacenter property not found when used in application.yml

I am creating spring-boot Eureka server and client micro-services to deploy on aws. I have read on tutorials that I have to define eureka.datacenter: cloud in my application.yml of eureka server so that it knows it is on aws. But when I try to use it in my application.yml file I get unknown property 'eureka.datacenter'. Dependencies I have included for eureka server.

 <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-eureka-server</artifactId>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-config</artifactId>
            </dependency>

            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-starter-eureka</artifactId>
            </dependency>

        </dependencies>

I am using Spring boot 1.5.8.RELEASE and spring cloud Edgware.SR1.

Is eureka.datacenter property included in different version of spring cloud?

application.yml

spring:
  application:
    name: eureka-svc

---
spring:
  profiles: localhost
server:
  port: 8761
eureka:
  instance:
    hostname: localhost
  client:   
    fetchRegistry: false
    register-with-eureka: false
    serviceUrl:
      defaultZone: http://localhost:8761/eureka
---
spring:
  profiles: aws
server:
  port: 8761 
eureka:
  instance:
    non-secure-port: ${server.port}
    environment: production
  client:
    region: region
    register-with-eureka: true
    fetchRegistry: true
    use-dns-for-fetching-service-urls: true
    eureka-server-d-n-s-name: dns-name
    eureka-server-port: 8761
    eureka-server-u-r-l-context: eureka
  server:
    a-w-s-access-id: access-id
    a-w-s-secret-key: aws-key
    binding-strategy: route53
    list-auto-scaling-groups-role-name: role-name

Don't you have to pass the eureka.datacenter as a commandline property?

Configuring Eureka

If you are running in the cloud environment, you will need to pass in the java commandline property -Deureka.datacenter=cloud so that the Eureka Client/Server knows to initialize the information specific to AWS cloud.

eureka.environment property value resolves to a blank string. � Issue , RELEASE and spring cloud Edgware.SR1. Is eureka.datacenter property included in different version of spring cloud? application.yml spring: application: name:� In Spring Eureka server exists the property "datacenter", what is the purpose of setting this? Do I need to set one if I am not running in standalone mode the server? Otherwise if I have zone/region for my peers, this property should have the same name to identify the zone they're? For example. eureka.datacenter=myname

I'm following the instructions from

https://cloud.spring.io/spring-cloud-netflix/multi/multi__service_discovery_eureka_clients.html#_using_eureka_on_aws

@EnableEurekaServer
@SpringBootApplication
public class DiscoveryServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(DiscoveryServiceApplication.class, args);
    }

    @Bean
    @Profile("aws")
    public EurekaInstanceConfigBean eurekaInstanceConfig(InetUtils inetUtils) {
        EurekaInstanceConfigBean b = new EurekaInstanceConfigBean(inetUtils);
        AmazonInfo info = AmazonInfo.Builder.newBuilder().autoBuild("eureka");
        b.setDataCenterInfo(info);
        return b;
    }

}

2. Service Discovery: Eureka Server, I am using application.yml and setting eureka.environment=prod property, GitHub is home to over 50 million developers working together to spring: application: name: eureka server: port: 80 #archaius: # deployment: # datacenter: If it's not used anywhere by Spring Cloud, then why does it clear out� Sorry I did not give enough details on this issue. I assume the yml file is not picked up by Spring Boot because, when initializing the app, I get a BeanCreationException on one of my controller classes: java.lang.IllegalArgumentException: Could not resolve placeholder 'property.value' in string value "${property.value}"

Might not make a difference but could you try:

eureka.datacenter: cloud

instead of:

eureka.datacenter=cloud

Spring Cloud, To include Eureka Server in your project, use the starter with a group ID of The Eureka server does not have a back end store, but the service instances in the registry all have to application.yml (Two Peer Aware Eureka Servers). Only explict way of setting the hostname is by setting eureka.instance.hostname property. Spring Cloud and Spring Boot, Part 5: Deploying the Eureka Server and Spring Boot Application in Docker The title pretty much tells you all you need to know. Let's get started with part 5!

Spring Cloud Netflix, If you have a bootstrap.yml (or properties) then those properties are used to configure First a bootstrap context is created from the classes found in spring. factories and then independent of the implementation (e.g. discovery via Eureka or Consul). IllegalArgumentException: Can not set org.springframework .web.client. I realized a couple of things now. My application.properties file is being loaded properly because I verified via the /env path (thanks Dave) that my DB properties are being loaded. The problem appears to be that when I run it using the Spring Boot maven plug-in,it fails to initialize my dataSource. mvn spring-boot:run

Spring boot cloud eureka server example, The following example shows a minimal Eureka client application: Therefore, the defaultZone property does not follow the normal Spring Boot snake-case support per-server basic auth credentials, so only the first set that are found is used. eureka.client.healthcheck.enabled=true should only be set in application .yml . This article contains Spring boot cloud eureka server example with step by step. Spring cloud provide netflix project for spring boot cloud implantation, Netflix provides eureka server feature to manage micro service spring boot application. Steps to configure Eureka server. add spring-cloud-starter-eureka-server dependency in pom.xml

How to Use Netflix's Eureka and Spring Cloud for Service Registry , Spring cloud provide netflix project for spring boot cloud implantation, Netflix using annotation in main class : @EnableEurekaServer; Add server port and eureka.client.register-with-eureka indicate that do not resister self as client eureka server application.yml properties as bellow, application.yml or� Note that in the code shown above the Spring Boot application demoservice starts on the port 9090. YAML File. Spring Boot supports YAML based properties configurations to run the application. Instead of application.properties, we can use application.yml file. This YAML file also should be kept inside the classpath.

Comments
  • What does your application.yml look like? I'm not aware of a eureka.datacenter property.
  • I have added application.yml.
  • yes I know that but on some posts online it was mention in .yml file. stackoverflow.com/questions/33659412/… github.com/spring-cloud/spring-cloud-netflix/issues/791
  • I did typing mistake while posting question. I did use eureka.datacenter: cloud. Sorry about that. I will edit question.