我在IDEA中创建了一个eureka项目,效果很好。但是,当我将它打包到战争中并扔到tomcat 8.5的webapp目录中时。重新启动tomcat后,我无法通过URL localhost:8761来访问它
EurekaApplication.java
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main( String[] args ) {
SpringApplication.run(EurekaApplication.class,args);
}
}
application.yml
server:
port: 8761
eureka:
instance:
hostname: localhost
client:
registerWithEureka: false
fetchRegistry: false
serverUrl:
defaultZone: http://localhost:${server.port}/eureka/
spring.cloud.config.discovery.enabled: true