springcloud官方文档地址:
http://cloud.spring.io/spring-cloud-static/Greenwich.SR1/single/spring-cloud.html
1.IDEA创建Spring项目
勾选eureka server需要的maven依赖,根据官方文档
然后点击下一步,点击finish完成项目。
启动类添加@EnableEurekaServer注解
编写properties.yml文件 参考官方文档(12.4 Standalone Mode)
server: port: 8761 eureka: instance: hostname: localhost client: registerWithEureka: false fetchRegistry: false serviceUrl: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
运行项目,访问http://localhost:8671,出现控制台页面,即EurekaServer服务搭建成功。