天天看点

SpringCloud - EurekaServer服务端搭建

1、application.yml 配置

#端口号
server:
  port: 8761

eureka:
  instance:
    #实例(服务)的名称
    appname: provider-service
    #主机名称、或者IP地址
    hostname: localhost
  #客户端访问地址
  client:
    service-url:
      defaulatZone: http://localhost:8761/eureka/
   #不自注册
    register-with-eureka: false
    #获取其他服务的注册地址
    fetch-registry: false


           

2、入口主类配置

注解:

@EnableEurekaServer