zoukankan      html  css  js  c++  java
  • SpringCloud------搭建注册中心Eureka

    1.Eureka图片概述

     2.添加依赖

    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
    </dependency>

    3.添加服务注册中心配置

    /src/main/resources/application.yml

    server:
      port: 8761
    
    eureka:
      instance:
        hostname: localhost
      client:
        registerWithEureka: true
        fetchRegistry: false
        serviceUrl:
          defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
        #server:
        #enable-self-preservation: false
    
    
    spring:
      application:
        name: shop-server

    4.添加启动类注解

    @SpringBootApplication
    @EnableEurekaServer
    public class ShopServerApplication {
    
        public static void main(String[] args) {
            SpringApplication.run(ShopServerApplication.class, args);
        }
    
    }

    5.启动项目

    访问Url

    http://localhost:8761/

    如图:

  • 相关阅读:
    常见问题
    查询
    多对多关系
    prototype & __proto__
    new operator
    用户
    express.Router
    Express 应用生成器
    LeanCloud
    npm常用命令
  • 原文地址:https://www.cnblogs.com/tianhengblogs/p/12361777.html
Copyright © 2011-2022 走看看