diff --git a/README.md b/README.md index 11124ff..0295530 100644 --- a/README.md +++ b/README.md @@ -1 +1,2 @@ ###配置中心 端口号 10001 +###注册中心 端口号 10002 diff --git a/eureka-server/.gitignore b/eureka-server/.gitignore new file mode 100644 index 0000000..8c1680a --- /dev/null +++ b/eureka-server/.gitignore @@ -0,0 +1,31 @@ +target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +.nb-gradle/ + +### maven ### +target +out +.mvn +mvnw +mvnw.cmd diff --git a/eureka-server/pom.xml b/eureka-server/pom.xml new file mode 100644 index 0000000..9901ce6 --- /dev/null +++ b/eureka-server/pom.xml @@ -0,0 +1,73 @@ + + + 4.0.0 + + com.micro.fast.eureka.server + eureka-server + 0.0.1-SNAPSHOT + jar + + eureka-server + eureka-server + + + org.springframework.boot + spring-boot-starter-parent + 1.5.4.RELEASE + + + + + UTF-8 + UTF-8 + 1.8 + Dalston.SR1 + 1.8 + 1.8 + 1.8 + + + + + org.springframework.cloud + spring-cloud-starter-config + + + org.springframework.cloud + spring-cloud-starter-eureka-server + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + diff --git a/eureka-server/src/main/java/com/micro/fast/eureka/server/EurekaServerApplication.java b/eureka-server/src/main/java/com/micro/fast/eureka/server/EurekaServerApplication.java new file mode 100644 index 0000000..fe48fea --- /dev/null +++ b/eureka-server/src/main/java/com/micro/fast/eureka/server/EurekaServerApplication.java @@ -0,0 +1,14 @@ +package com.micro.fast.eureka.server; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; + +@SpringBootApplication +@EnableEurekaServer //开启注册中心相关服务 +public class EurekaServerApplication { + + public static void main(String[] args) { + SpringApplication.run(EurekaServerApplication.class, args); + } +} diff --git a/eureka-server/src/main/resources/bootstrap.yml b/eureka-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000..63e8596 --- /dev/null +++ b/eureka-server/src/main/resources/bootstrap.yml @@ -0,0 +1,8 @@ +#从配置中心加载配置文件,启动eureka-server服务 +spring: + cloud: + config: + uri: http://localhost:10001/ + profile: dev + label: master + name: eureka-server diff --git a/eureka-server/src/test/java/com/micro/fast/eureka/server/EurekaServerApplicationTests.java b/eureka-server/src/test/java/com/micro/fast/eureka/server/EurekaServerApplicationTests.java new file mode 100644 index 0000000..ab72f53 --- /dev/null +++ b/eureka-server/src/test/java/com/micro/fast/eureka/server/EurekaServerApplicationTests.java @@ -0,0 +1,16 @@ +package com.micro.fast.eureka.server; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class EurekaServerApplicationTests { + + @Test + public void contextLoads() { + } + +}