eureka-server配置,一个eureka完成

src/main/java/com/zsn/app/EurekaApp.java

package com.zsn.app;

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

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

 

src/main/resources/application.yml

server:
  port: 8888
eureka:
  instance:
     hostname: localhost
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

pom.xml   请参照 https://mp.csdn.net/postedit/81448522

    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    4.0.0
    com.eureka.server
    eureka-server1
    0.0.1-SNAPSHOT

    
        spring.cloud.parent
        spring-cloud-parent
        0.0.1-SNAPSHOT
    

你可能感兴趣的:(eureka-server配置,一个eureka完成)