作者:Eddy  历史版本:1  最后编辑:龚清  更新时间:2024-05-28 11:17

编写版本:v3.5.0
适用版本:v3.5.0+

切换文件存储方式

platform下的config/application-app.yml

#fastdfs: fastdfs, db: 数据库, disk: 硬盘, minio: minio, aliyunoss: 阿里云OSS对象存储
file:
  saveType: ${FILE_SAVETYPE:minio}

使用fastdfs文件存储

  • 方式一 工程ibps-response中修改application-fileserver.yml配置文件
    fastdfs:
    pool:
      max-idle: ${FASTDFS_MAX_IDLE:xx}
      min-idle: ${FASTDFS_MIN_IDLE:xx}
      max-total: ${FASTDFS_MAX_TOTAL:xxx}
      max-wait-millis: ${FASTDFS_MAX_WAIT_MILLIS:xxxx}
      time-between-eviction-runs-millis: ${FASTDFS_TIME_BETWEEN_EVICTION_RUNS_MILLIS:xxxx}
      min-evictable-idle-time-millis: ${FASTDFS_MIN_EVICTABLE_IDLE_TIME_MILLIS:xxxxx}
      test-on-borrow: ${FASTDFS_TEST_ON_BORROW:true}
    common:
    #    expire-time: 600
      retry-count: x
    #    config-path: config/fdfs_client.conf
    #    charset: utf-8
      connect-timeout-in-seconds: x
      network-timeout-in-seconds: x
      # primary pool
      pool:
        enabled: ${FASTDFS_COMMON_POOL_ENABLED:false}
  • 方式二 启动时设置系统变量
    • Linux系统
      export FASTDFS_MAX_IDLE=
      export FASTDFS_MIN_IDLE=
      export FASTDFS_MAX_TOTAL=
      export FASTDFS_MAX_WAIT_MILLIS=
      export FASTDFS_TIME_BETWEEN_EVICTION_RUNS_MILLIS=
      export FASTDFS_MIN_EVICTABLE_IDLE_TIME_MILLIS=
      export FASTDFS_TEST_ON_BORROW=
      export FASTDFS_COMMON_POOL_ENABLED=
    • Windows系统
      set FASTDFS_MAX_IDLE=
      set FASTDFS_MIN_IDLE=
      set FASTDFS_MAX_TOTAL=
      set FASTDFS_MAX_WAIT_MILLIS=
      set FASTDFS_TIME_BETWEEN_EVICTION_RUNS_MILLIS=
      set FASTDFS_MIN_EVICTABLE_IDLE_TIME_MILLIS=
      set FASTDFS_TEST_ON_BORROW=
      set FASTDFS_COMMON_POOL_ENABLED=

使用minio文件存储

  • 方式一 工程ibps-response中修改application-minio.yml配置文件
    io:
    minio:
      endpoint: ${MINIO_ENDPOINT:http://ip}
      port: ${MINIO_PORT:xxxx}
      insecure: ${MINIO_INSECURE:false}
      accessKey: ${MINIO_ACCESSKEY:xxxx}
      secretKey: ${MINIO_SECRETKEY:xxxxxxxx}
      bucket: ${MINIO_BUCKET:ibps}
  • 方式二 启动时设置系统变量
    • Linux系统
      export MINIO_ENDPOINT=
      export MINIO_PORT=
      export MINIO_INSECURE=
      export MINIO_ACCESSKEY=
      export MINIO_SECRETKEY=
      export MINIO_BUCKET=
    • Windows系统
      set MINIO_ENDPOINT=
      set MINIO_PORT=
      set MINIO_INSECURE=
      set MINIO_ACCESSKEY=
      set MINIO_SECRETKEY=
      set MINIO_BUCKET=

使用阿里云OSS存储

  • 方式一 工程ibps-response中修改application-aliyunoss.yml 配置文件
    aliyun:
    oss:
      endpoint: ${ALIYUN_OSS_ENDPOINT:}
      access-key-id: ${ALIYUN_OSS_ACCESS_KEY_ID:}
      access-key-secret: ${ALIYUN_OSS_ACCESS_KEY_SECRET:}
      bucket: ${ALIYUN_OSS_BUCKET:ibps}
      max-connections: ${ALIYUN_OSS_MAX_CONNECTIONS:xxx}
      socket-timeout-ms: ${ALIYUN_OSS_SOCKET_TIMEOUT_MS:xxx}
      connection-timeout-ms: ${ALIYUN_OSS_CONNECTION_TIMEOUT_MS:xxxx}
      connection-request-timeout-ms: ${ALIYUN_OSS_CONNECTION_REQUEST_TIMEOUT_MS:xxxx}
      idle-connection-time-ms: ${ALIYUN_OSS_IDLE_CONNECTION_TIME_MS:xxxx}
      max-error-retry: ${ALIYUN_OSS_MAX_ERROR_RETRY:x}
      protocol: ${ALIYUN_OSS_PROTOCOL:https}
  • 方式二 启动时设置系统变量
    • Linux系统
      export ALIYUN_OSS_ENDPOINT=
      export ALIYUN_OSS_ACCESS_KEY_ID=
      export ALIYUN_OSS_ACCESS_KEY_SECRET=
      export ALIYUN_OSS_BUCKET=
      export ALIYUN_OSS_MAX_CONNECTIONS=
      export ALIYUN_OSS_SOCKET_TIMEOUT_MS=
      export ALIYUN_OSS_CONNECTION_TIMEOUT_MS=
      export ALIYUN_OSS_CONNECTION_REQUEST_TIMEOUT_MS=
      export ALIYUN_OSS_IDLE_CONNECTION_TIME_MS=
      export ALIYUN_OSS_MAX_ERROR_RETRY=
      export ALIYUN_OSS_PROTOCOL=
    • Windows系统
      set ALIYUN_OSS_ENDPOINT=
      set ALIYUN_OSS_ACCESS_KEY_ID=
      set ALIYUN_OSS_ACCESS_KEY_SECRET=
      set ALIYUN_OSS_BUCKET=
      set ALIYUN_OSS_MAX_CONNECTIONS=
      set ALIYUN_OSS_SOCKET_TIMEOUT_MS=
      set ALIYUN_OSS_CONNECTION_TIMEOUT_MS=
      set ALIYUN_OSS_CONNECTION_REQUEST_TIMEOUT_MS=
      set ALIYUN_OSS_IDLE_CONNECTION_TIME_MS=
      set ALIYUN_OSS_MAX_ERROR_RETRY=
      set ALIYUN_OSS_PROTOCOL=

配置文件每项 x 和 系统变量=后的值,根据需求定义