spring cloud eureka相关的配置信息
相关参考地址
https://blog.csdn.net/yuanshangshenghuo/article/details/106962926
eurake 启动入口加 @EnableEurekaServer 标签
package com.server.eureka;
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);
}
}
yml 相关文件配置信息
server: # 服务端口
port: 9090
spring:
application: # 应用名字,eureka 会根据它作为服务id
name: spring-cloud-eureka-server
eureka:
instance:
hostname: localhost
client:
service-url: # eureka server 的地址, 咱们单实例模式就写自己好了
defaultZone: http://localhost:9090/eureka
register-with-eureka: true # 不向eureka server 注册自己
fetch-registry: true # 不向eureka server 获取服务列表
还没有评论,来说两句吧...