spring cloud 之consul

1、安装consul

2、consul agent -dev启动

3、

server:
  port: 9001


spring:
  servlet:
    multipart:
      max-file-size: 100MB
      max-request-size: 100MB
  profiles:
    active: dev
  application:
    name: enc-provider
  redis:
    database: 0
    host: 10.xx.xx
    port: 6379
    timeout: 5000
  datasource:
    url: jdbc:mysql://10.xx.xx:3306/enc-oss-view?useUnicode=yes&characterEncoding=UTF-8
    username: root
    password: root
    driver-class-name: com.mysql.cj.jdbc.Driver
  cloud:
    consul:
      host: 10.xx.xx
      port: 8500
      discovery:
        prefer-ip-address: true
        health-check-critical-timeout: 30s
  kafka:
    bootstrap-servers: 10.xx.xx:9092
    producer:
      retries: 0
      batch-size: 16384
      buffer-memory: 33554432
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer

management:
  endpoints:
    web:
      exposure:
        include: "*"

mybatis:
  mapper-locations:
    - classpath*:/mapper/*-mapper.xml
  config-location: classpath:mybatis-config.xml




#mapper
mapper:
    mappers: com.encdata.oss.starter.web.base.EncMapper
    not-empty: false
    identity: MYSQL

#pagehelper
pagehelper:
    helperDialect: mysql
    reasonable: true
    supportMethodsArguments: true
    params: count=countSql
    pageSizeZero: true
    rowBoundsWithCount: true
    offsetAsPageNum: true


#日志
logging:
  config: classpath:logback-${spring.profiles.active}.xml


info:
  security:
    enabled: false
    jwtSecret: encdata2019
    defaultExpiredDate: 1800
    whiteUrlList:
      - /user/login


fdfs:
  enabled: true
  # 读取时间
  soTimeout: 5000
  # 连接超时时间
  connectTimeout: 5000
  # 缩略图
  thumbImage:
    width: 150
    height: 150
  # tracker列表
  trackerList: 10.xx.xx:22122
  return-url: http://10.xx.xx:9999/

4、注解

@SpringBootApplication
@EnableDiscoveryClient
@EnableTransactionManagement
@MapperScan(value = "com.xx.oss.bakend.mapper",annotationClass = Repository.class)
@EnableFeignClients(basePackages = {"com.xx.oss.user.api"})
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值