springcloud随笔一
Eurake服务:
启动类:
@SpringBootApplication @EnableEurekaClient @EnableEurekaServer @EnableHystrixDashboard public class EurekaServer_7997 { public static void main(String[] args) { SpringApplication.run(EurekaServer_7997.class, args); } }
配置文件:
server: port: 8000 eureka: instance: hostname: dev.eureka8000.org client: register-with-eureka: false fetch-registry: false service-url: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ #defaultZone: http://dev.eureka7997.org:7997/eureka/,http://dev.eureka7998.org:7998/eureka/,http://dev.eureka7999.org:7999/eureka/,http://dev.eureka8000.org:8000/eureka/
maven依赖:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId> </dependency>