博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
springcloud eureka注册中心搭建
阅读量:2825 次
发布时间:2019-05-14

本文共 3155 字,大约阅读时间需要 10 分钟。

配置pom.xml

4.0.0
org.springframework.boot
spring-boot-starter-parent
2.0.8.RELEASE
com.urthink.upfs
upfs-register
0.0.1-SNAPSHOT
upfs-register
Upfs register project for Spring Boot
1.8
Finchley.SR2
org.springframework.boot
spring-boot-starter
org.springframework.boot
spring-boot-starter-logging
org.springframework.boot
spring-boot-starter-log4j2
org.springframework.boot
spring-boot-starter-actuator
org.springframework.cloud
spring-cloud-starter-netflix-eureka-server
org.projectlombok
lombok
true
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

配置application.yml

spring:  application:    name: upfs-registerserver:  port: 8761eureka:  instance:    hostname: localhost  client:    register-with-eureka: false # 实例是否在eureka服务器上注册自己的信息以供其他服务发现,默认为true    fetch-registry: false   # 此客户端是否获取eureka服务器注册表上的注册信息,默认为true    serviceUrl:        defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

启动类

package com.urthink.upfs.register;import lombok.extern.slf4j.Slf4j;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;/** * 注册中心 * @author zhao * @date 2019.1.14 */@SpringBootApplication@EnableEurekaServer//@Slf4jpublic class UpfsRegisterApplication {    public static void main(String[] args) {        SpringApplication.run(UpfsRegisterApplication.class, args);        System.out.println("upfs-register startup completed.");    }}

访问

Eureka 开发时快速剔除失效服务

eureka 客户端springcloud service

转载地址:http://hymhd.baihongyu.com/

你可能感兴趣的文章
使用AFN 的POST请求出现错误"Error Domain=NSCocoaErrorDomain Code=3840 "决绝方案
查看>>
iOS 调试问题记录(一)
查看>>
UITextView自定义封装(带placeHolder)
查看>>
基于MBProgressHUD的封装
查看>>
iOS应用程序的生命周期
查看>>
Xcode个人常用插件总结
查看>>
iOS MVVM+RAC 从框架到实战
查看>>
iOS原生二维码扫描
查看>>
iOS多语言功能开发小结
查看>>
iOS 如何设置一整张图片作为背景图片(穿透导航栏)
查看>>
一个iOS程序员的BAT面试经验
查看>>
几句代码快速集成自定义转场效果+ 全手势驱动
查看>>
Swift3.0已出坑-适配iOS10,项目迁移Swift3.0问题总结。
查看>>
[iOS]动态修改app 图标(icon)
查看>>
SpringMVC_JSON
查看>>
SpringMVC_国际化
查看>>
SpringMVC_文件上传
查看>>
SpringMVC_拦截器
查看>>
在SSM中整合MongoDB
查看>>
SpringMVC_异常
查看>>