• 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$
    
    
    不经一番彻骨寒,哪有梅花扑鼻香?
  • 相关阅读:
    vue中的样式
    v-model 双向数据绑定
    v-on 事件修饰符
    Linq Join
    Elasticsearch.Net 异常:[match] query doesn't support multiple fields, found [field] and [query]
    MongoDB开启权限认证
    elasticsearch备份与恢复
    elasticserach + kibana环境搭建
    Kibana TypeError : Object #<GlobalState> has no method 'setDefaults'
    匿名函数
  • 原文地址:https://www.cnblogs.com/zongyao/p/13831158.html
Copyright © 2020-2023  润新知