当前位置:网站首页>关于eureka启动成功但是访问404问题

关于eureka启动成功但是访问404问题

2022-06-21 20:32:00 律二萌萌哒

Eureka server yml配置文件

server:
  port: 10087 #服务端口
spring:
  application:
    name: eureka-server #微服务名称
eureka:
  client:
    service-url:
      defaultZone: http://localhost:10087/eureka
    fetch-registry: false  #关闭检索服务


Eureka启动类

package cn.itcast;

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

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

启动成功

在这里插入图片描述

注意:这里访问Eureka地址是http://localhost:10087 而不是http://localhost:10087/eureka/,把/eureka/去掉即可

成功访问

在这里插入图片描述

原网站

版权声明
本文为[律二萌萌哒]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_22075913/article/details/125360237