创建modul

然后就创建完成了

添加yml文件:

server:
port:
eureka:
client:
register-with-eureka: false #单机版建议设置为false,设置false的目的是防止自己注册自己,集群版采用默认的true
fetch-registry: false #单机版建议设置为false,设置false的目的是防止自己发现自己,集群版采用默认的true
spring:
application:
name: eureka-server

pom文件:

<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>springcloud-parent</artifactId>
<groupId>com.cxy</groupId>
<version>0.0.-SNAPSHOT</version>
</parent>
<modelVersion>4.0.</modelVersion> <artifactId>spring-eureka</artifactId>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
</dependencies> </project>

使用dubbo开发的时候,dubbo的注册中心是zookeeper,

zookeeper是不需要写代码去操作的,而这里不是的,

是以程序的方式启动,zookeeper或者consul也是可以的,只是服务需要自己启动

添加启动类

package com.cxy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /***
* @ClassName: EuekaApplication
* @Description:
* @Auther: 陈绪友
* @Date: 2019/1/2815:43
* @version : V1.0
*/
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class,args);
}
}

启动点击run

输入http://localhost:8761/

代表注册中心就搭建好了

springcloud系列二 搭建注册中心启动的更多相关文章

  1. springcloud入门系列(二):注册中心Eureka

    搭建注册中心Eureka 1.pom中依赖 <dependencies> <dependency> <groupId>org.springframework.clo ...

  2. 《springcloud 一》搭建注册中心,服务提供者,服务消费者

    注册中心环境搭建 Maven依赖信息 <parent> <groupId>org.springframework.boot</groupId> <artifa ...

  3. SpringCloud搭建注册中心与服务注册

    上一篇文章<微服务注册中心原理,看这篇就够了!>介绍了注册中心的概念和原理,本文将介绍下利用Eureka搭建中心并注册服务到注册中心的过程. 本文目录 一.Eureka介绍二.搭建注册中心 ...

  4. 【springcloud】Eureka服务注册中心搭建

    转自:https://blog.csdn.net/pengjunlee/article/details/86538997 Spring Cloud是一系列框架的集合,它利用Spring Boot的开发 ...

  5. 搭建简单的SpringCloud项目一:注册中心和公共层

    注:笔者在搭建途中其实遇见不少问题,统一放在后面的文章说明,现在的搭建是测试OK的. GitHub:https://github.com/ownzyuan/test-cloud 后续:搭建简单的Spr ...

  6. Spring Cloud 系列之 Consul 注册中心(二)

    本篇文章为系列文章,未读第一集的同学请猛戳这里:Spring Cloud 系列之 Consul 注册中心(一) 本篇文章讲解 Consul 集群环境的搭建. Consul 集群 上图是一个简单的 Co ...

  7. Spring-cloud(二)注册服务提供者搭建

    上文已经写了如何去搭建注册中心,仅有注册中心是远远不够的,所以我们需要注册到注册中心并提供服务的节点,这里称为注册服务提供者 前提 阅读上文,并成功搭建注册中心,环境无需改变 项目搭建 这里我们需要新 ...

  8. SpringCloud(二)注册服务提供者搭建

    上文已经写了如何去搭建注册中心,仅有注册中心是远远不够的,所以我们需要注册到注册中心并提供服务的节点,这里称为注册服务提供者 前提 阅读上文,并成功搭建注册中心,环境无需改变 项目搭建 这里我们需要新 ...

  9. 跟我学SpringCloud | 第二篇:注册中心Eureka

    Eureka是Netflix开源的一款提供服务注册和发现的产品,它提供了完整的Service Registry和Service Discovery实现.也是springcloud体系中最重要最核心的组 ...

随机推荐

  1. 使用AJAX异步提交表单的几种方式

    方式一 手工收集所有的用户输入,封装为大的“k1=v1&k2=v2…”键值对形式,使用$.post(url, data,fn)把数据提交给服务器 $.ajax({ type:'post', u ...

  2. Git中远程仓库的使用

    1.查看当前的远程库 要查看当前配置有哪些远程仓库,可以用 git remote 命令,它会列出每个远程库的简短名字.在克隆完某个项目后,至少可以看到一个名为 origin 的远程库,Git 默认使用 ...

  3. DevTools in Spring Boot 1.3

    Spring Boot 1.3 will ship with a brand new module called spring-boot-devtools. The aim of this modul ...

  4. Python单例模式剖析

    在聊这之前我们首先要明确的是,单例模式在实际中的意义以及在python中具有实现的价值? 当前,相信有很多人支持单例模式,也有不少人反对,尤其是在python中,目前依旧具有很大的争议性.我们要在评论 ...

  5. Linux下修改Mysql最大并发连接数

    输入的命令如下: /usr/local/mysql/bin/mysqladmin -uroot -pyyyyyy variables |grep max_connections nano /etc/m ...

  6. Quartz_1_简单编程式任务调度使用(SimpleTrigger)

    最近在工作中,要做定时任务的更能,最开始的时候,想到的是 JavaSE 中,自带 Timer 及 TimerTask 联合使用,完成定时任务.最后发现,随着业务的复杂,JDK 中的 Timer 和 T ...

  7. js中FOR循环的陷阱

    //闭包解决 循环输出的问题 for(var i=0;i<rows.length;i++) {( function (i) { })(i);

  8. 【总结整理】AMAP学习AMAP.PlaceSearch()

    http://lbs.amap.com/api/javascript-api/reference/search#m_AMap.PlaceSearch http://lbs.amap.com/api/j ...

  9. php 中两种获得数据库中 数据条数的方法

    一种是传统的利用mysql_num_rows()来计算 $sql="select * from news"; $res=mysql_query($sql); $number=mys ...

  10. ubuntu16安装pylearn2 出现错误提示importerror:no module named six.moves

    由于市面上的一些教程时间比较早,入门学习时跟随教程安装容易出现各种错误,这些错误基本都是版本不同导致的 所以,我们安装过程中一定要指出包的版本,如果你已经遇到no module named six.m ...