zoukankan      html  css  js  c++  java
  • springcloud通过yml配置文件配置Mysql等相关配置

    server:
      port: 8001
      
    mybatis:
      config-location: classpath:mybatis/mybatis.cfg.xml        # mybatis配置文件所在路径
      type-aliases-package: com.atguigu.springcloud.entities    # 所有Entity别名类所在包
      mapper-locations:
      - classpath:mybatis/mapper/**/*.xml                       # mapper映射文件
    spring:
      datasource: #配置数据源四要素
        url: jdbc:mysql://localhost:3306/cloudDB01?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
        username: root
        password: 123456
        driver-class-name: com.mysql.cj.jdbc.Driver
      application: #服务名称
        name: microservicecloud-dept
        dbcp2:
          min-idle: 5                                           # 数据库连接池的最小维持连接数
          initial-size: 5                                       # 初始化连接数
          max-total: 5                                          # 最大连接数
          max-wait-millis: 200                                  # 等待连接获取的最大超时时间
          
    eureka:
      client: #客户端注册进eureka服务列表内
        service-url: 
          #defaultZone: http://localhost:7001/eureka
           defaultZone: http://eureka7001.com:7001/eureka/,http://eureka7002.com:7002/eureka/,http://eureka7003.com:7003/eureka/      
      instance:
        instance-id: microservicecloud-dept8001
        prefer-ip-address: true     #访问路径可以显示IP地址     
     
    info: 
      app.name: atguigu-microservicecloud
      company.name: www.atguigu.com
      build.artifactId: $project.artifactId$
      build.version: $project.version$
    
    
    不经一番彻骨寒,哪有梅花扑鼻香?
  • 相关阅读:
    1.8 接口中的静态方法
    1.7 默认方法
    1.6 变量作用域
    汉字转拼音
    1.5 构造器引用
    1.4 方法引用
    循环中冲不掉外部定义的变量
    getBoundingClientRect
    Angular1.0 在Directive中调用Controller的方法
    horizontalDragMaxWidth:0;就没有水平滚动条了
  • 原文地址:https://www.cnblogs.com/zongyao/p/13831158.html
Copyright © 2011-2022 走看看