springcloud目录:
1.Spring Cloud简介
2.SpringCloud整合eureka注册中心
3.SpringCloud整合服务注册
4.SpringCloud整合服务间的调用即负载均衡
5.SpringCloud整合Feign调用
6.SpringCloud整合config配置中心
7.SpringCloud整合zuul路由网关
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.2.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.yqx</groupId>
<artifactId>yqx-eureka</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>yqx-eureka</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
#服务端口号
server.port=8000
#服务名称
spring.application.name=yqx-eureka
#注册到eurekaip地址
eureka.instance.hostname=127.0.0.1
#注册地址
eureka.client.service-url.defaultZone=http://127.0.0.1:8000/eureka
#因为自己是为注册中心,不需要自己注册自己,默认为true(集群的时候是需要为true的)
eureka.client.register-with-eureka=false
#因为自己是为注册中心,不需要检索服务,默认为true
eureka.client.fetch-registry=false
在启动类上加上@EnableEurekaServer
在浏览器输入注册中心的管理界面地址:http://127.0.0.1:8000/