【汇智学堂】微服务-SpringCloud(Eureka+Ribbon)之一

自闭症网瘾萝莉.ら 提交于 2020-01-15 04:31:01

New Project:
在这里插入图片描述
在这里插入图片描述

delete src;

New Module:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
dependencies,as this:
在这里插入图片描述
在这里插入图片描述

application.yml:

server:
  port: 8761
eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka
  server:
    enable-self-preservation: false

DemoserverApplication:

package com.huizhi.demoserver;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;

@SpringBootApplication
@EnableEurekaServer
public class DemoserverApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoserverApplication.class, args);
    }

}

run,localhost:8761:
在这里插入图片描述

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!