0
点赞
收藏
分享

微信扫一扫

虫洞操纵者

小_北_爸 2024-08-13 阅读 34
eurekajava

创建一个eureka-server的模块

在pom中引入eureka

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

在application.yml文件中配置Eureka

server:
  port: 8079

eureka:
  instance:
    hostname: bowen-eureka
  client:
    register-with-eureka: false
    fetch-registry: false
    service-url:
      defalutZone: http://${eureka.instance.hostname}:${server.port}/eureka/

创建 EurekaServerApplication 启动类

package com.lingyang;

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

/**
 * @author **文
 * @Description:
 * @createDate 2024/8/12 14:25
 **/
@SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {

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

}

最后我被坑了,eureka不维护了。我用jdk17搞。操蛋了。解决不了

举报

相关推荐

0 条评论