springcloud - eureka client的使用

环境:

idea

jdk1.8

注册中心,点此进

创建项目:

创建成功后先修改版本号和注册中心server保持一致

加上web依赖,负责启动就会停止:

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>

启动类添加@EnableDiscoveryClient

注解

将application.properties文件改问yml格式,添加内容如下:

启动,访问注册中心http://localhost:8761/ ,如下图:

猜你喜欢

转载自blog.csdn.net/qq_26857649/article/details/82659752