yml.md 1.9 KB

项目配置

默认配置

spring:
  application:
    name:                               datacenter
  mvc:
    favicon:
      enabled:                          true

  jmx:
    default-domain:                     datacenter

  datasource:
    name:                               datacenter
    type:                               com.alibaba.druid.pool.DruidDataSource
    driver-class-name:                  org.postgresql.Driver

  jms:
    pub-sub-domain:                     true

mybatis:
  typeAliasesPackage:                   cn.sagacloud.server.datacenter.entities

开发环境配置

# spring-cloud相关配置
eureka:
  client:                                   #客户端注册进eureka服务列表内
    service-url:
        defaultZone:                          http://192.168.20.236:8761/eureka

  instance:
    # 实例ID
    # instance-id:                            ${spring.application.name}:${server.port}:${project.version}
    # 优先使用IP地址方式进行注册服务
    prefer-ip-address:                      true

#启用监控
management:
  endpoints:
    web:
      exposure:
        include:
          - "*"  # 开放所有端点health,info,metrics,通过actuator/+端点名就可以获取相应的信息。默认打开health和info
  endpoint:
    health:
      #未开启actuator/health时,我们获取到的信息是{"status":"UP"},status的值还有可能是 DOWN。开启后打印详细信息
      show-details:                       always

server:
  port: 8081

spring:
  datasource:
    url:                                jdbc:postgresql://192.168.20.236:5432/datacenter
    username:                           postgres
    password:                           123456

  servlet:
    multipart:
      max-request-size:                500MB        # 限制上传的多个文件的总大小
      max-file-size:                   500MB        # 限制单个文件的最大值

线上环境配置