组件名:Netflix Eureka 

作用:支撑微服务的自注册、自发现,提供负载均衡能力

开发环境使用IDEA

1.新建Eureka Server,新建maven项目,配置pom.xml
  1. <parent>
  2. <groupId>org.springframework.cloud</groupId>
  3. <artifactId>spring-cloud-starter-parent</artifactId>
  4. <version>Camden.SR5</version>
  5. </parent>
  6. <dependencies>
  7. <dependency>
  8. <groupId>org.springframework.cloud</groupId>
  9. <artifactId>spring-cloud-starter</artifactId>
  10. </dependency>
  11. <dependency>
  12. <groupId>org.springframework.cloud</groupId>
  13. <artifactId>spring-cloud-starter-eureka-server</artifactId>
  14. </dependency>
  15. </dependencies>

2.新建包及启动类
  1. @SpringBootApplication
  2. @EnableEurekaServer
  3. public class Application {
  4. public static void main(String[] args){
  5. SpringApplication.run(Application.class,args);
  6. }
  7. }

 3.新建配置文件application.yml
  1. server:
  2. port: 1000
  3. eureka:
  4. instance:
  5. hostname: localhost
  6. client:
  7. register-with-eureka: false
  8. fetch-registry: false
  9. spring:
  10. application:
  11. name: eureka-server
这里主要注意我们的服务注册端口是1000

4.运行程序,打开浏览器127.0.0.1:1000
 
erueka服务器启动成功,目前还未有服务注册

代码:https://github.com/tilv37/eureka-server

Spring Cloud探路(一) Erueka服务器的建立的更多相关文章

  1. Spring Cloud Gateway注册到服务器中心(Consul)

    Spring Cloud Gateway注册到服务器中心(Consul) 准备环境 启动Consul(./consul agent -dev)作为服务中心,默认是8500端口,然后启动spring-c ...

  2. Spring Cloud探路(三)REST 客户端Feign

    Declarative REST Client: Feign Feign is a declarative web service client. It makes writing web servi ...

  3. Spring Cloud探路(二) Erueka客户端的建立

    接上篇 1.pom.xml与上篇一致 2.新建包及Application启动类 @Configuration @ComponentScan @EnableEurekaClient @EnableAut ...

  4. 朱晔和你聊Spring系列S1E8:凑活着用的Spring Cloud(含一个实际业务贯穿所有组件的完整例子)

    本文会以一个简单而完整的业务来阐述Spring Cloud Finchley.RELEASE版本常用组件的使用.如下图所示,本文会覆盖的组件有: Spring Cloud Netflix Zuul网关 ...

  5. Dapr 能否取代 Spring Cloud?

    很多人都是使用SpringBoot 和 Spring Cloud来开发微服务.Dapr 也是开发微服务的框架,它和Spring Cloud有什么区别呢,其实这不是一个区别的问题,它是不同的时代需要不同 ...

  6. 微服务架构-选择Spring Cloud,放弃Dubbo

    Spring Cloud 在国内中小型公司能用起来吗?从 2016 年初一直到现在,我们在这条路上已经走了一年多. 在使用 Spring Cloud 之前,我们对微服务实践是没有太多的体会和经验的.从 ...

  7. 放弃Dubbo,选择最流行的Spring Cloud微服务架构实践与经验总结

    http://developer.51cto.com/art/201710/554633.htm Spring Cloud 在国内中小型公司能用起来吗?从 2016 年初一直到现在,我们在这条路上已经 ...

  8. spring cloud 配置纲要Properties

    名称 默认 描述 encrypt.fail-on-error true 标记说,如果存在加密或解密错误,进程将失败. encrypt.key   对称密钥.作为一个更强大的替代方案,考虑使用密钥库. ...

  9. 聊聊Spring Cloud Config

    Spring Cloud Config 转自:https://blog.csdn.net/fjnpysh/article/details/71307311 现今这个时候,微服务大行其道,互联网应用遍地 ...

随机推荐

  1. 数据库lib7第2, 3题(创建索引和触发器)

    2. 分别为上述建立的表格建立适当的索引,请描述建立索引的过程(可以截图或者写SQL).其中,要求对SPJ标中的SNo, PNo字段各建立一个索引,为(PNo, JNo)的组合建立一个索引.请问,SN ...

  2. eclipse忽略js文件报错

    eclipse中js文件报错的情况,或许大家早已习以为常了,那么有什么好的方法可以将其忽略掉呢?如果你也在寻找此问题,那么本文或许可以帮助到你忽略某个js文件报错的方法: Project Proper ...

  3. CC2540 / CC2541 竟然支持 Bluetooth BLE 5.0?

    CC2540 / CC2541 竟然支持 Bluetooth BLE 5.0? 无意中发现 CC2541 的 BLE 协议栈更新了. BLE-STACK is Bluetooth 5.0 qualif ...

  4. oracle函数的分类

    v  单行函数:对每一行输入值进行计算,得到相应的计算结果,返回给用户,也就是说,每行作为一个输入参数,经过函数计算得到每行的计算结果. 比如select length(ename) from emp ...

  5. UVA_458:The Decoder

    Language:C++ 4.8.3  PS:ASCII值减去七 #include<stdio.h> #include<string.h> int main(void) { c ...

  6. git操作——TortoiseGit指定某个分支clone

    需求 需要使用TortoiseGit 克隆某个项目分支 操作 勾选分支,输入分支名称clone代码即可

  7. LeetCode91 Decode Ways

    题目: A message containing letters from A-Z is being encoded to numbers using the following mapping: ' ...

  8. AtCoder Beginner Contest 075 D - Axis-Parallel Rectangle【暴力】

    AtCoder Beginner Contest 075 D - Axis-Parallel Rectangle 我要崩溃,当时还以为是需要什么离散化的,原来是暴力,特么五层循环....我自己写怎么都 ...

  9. oracle获取中文出现乱码问题解决

    首先搞清楚字符集和字符编码概念,了解oracle字符集原理,请参考一位大神的讲解: ref:http://blog.csdn.net/dbanote/article/details/9158367#c ...

  10. 2018-8-10-WPF-轻量级-MVVM-框架入门-2.1.2

    title author date CreateTime categories WPF 轻量级 MVVM 框架入门 2.1.2 lindexi 2018-08-10 19:16:51 +0800 20 ...