Spring Cloud构建微服务架构(一)——服务注册与发现

This commit is contained in:
程序猿DD
2016-05-31 21:38:15 +08:00
parent 3e98eace74
commit 469798e649
4 changed files with 26 additions and 18 deletions
@@ -4,8 +4,8 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
@SpringBootApplication
public class Application {
public static void main(String[] args) {
@@ -0,0 +1,6 @@
server.port=1111
#eureka.instance.hostname=localhost
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
@@ -1,12 +0,0 @@
# 配置应用服务器(Tomcat)
server:
port: 1111 # HTTP端口
# 配置发现服务器(Discovery Server)
eureka:
instance:
hostname: localhost
client: # 不是客户端,所以不注册自己
registerWithEureka: false
fetchRegistry: false