jabrena / SpringCloudLab

SpringCloud examples
MIT License
0 stars 1 forks source link

Eureka Server #42

Open jabrena opened 8 years ago

jabrena commented 8 years ago

http://cloud.spring.io/spring-cloud-static/spring-cloud.html#_spring_cloud_netflix

@Autowired
private EurekaClient discoveryClient;

public String serviceUrl() {
    InstanceInfo instance = discoveryClient.getNextServerFromEureka("STORES", false);
    return instance.getHomePageUrl();
}
jabrena commented 8 years ago
eureka.instance.leaseRenewalIntervalInSeconds 
jabrena commented 8 years ago
---
spring:
  profiles: peer1
eureka:
  instance:
    hostname: peer1
  client:
    serviceUrl:
      defaultZone: http://peer2/eureka/

---
spring:
  profiles: peer2
eureka:
  instance:
    hostname: peer2
  client:
    serviceUrl:
      defaultZone: http://peer1/eureka/
jabrena commented 8 years ago
eureka.instance.preferIpAddress
jabrena commented 8 years ago

https://github.com/Netflix/eureka/wiki/Understanding-Eureka-Peer-to-Peer-Communication http://netflix.github.io/eureka/javadoc/eureka-core/com/netflix/eureka/EurekaServerConfig.html https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication

jabrena commented 8 years ago

https://github.com/spring-cloud/spring-cloud-netflix/issues/203

jabrena commented 8 years ago

server: port: 9000 ssl: enabled: true key-store: classpath:keystore.jks key-store-password: password key-alias: tomcat

https://github.com/spring-cloud/spring-cloud-netflix/issues/459