企业微信

参考下面的项目自己完成

构建 s3 存储

  • 下载

    1. wget http://dl.minio.org.cn/server/minio/release/linux-amd64/minio
  • 运行

    1. # --compat兼容aws s3
    2. mkdir ./s3
    3. MINIO_ROOT_USER=minio MINIO_ROOT_PASSWORD=minio123 ./minio --compat server $PWD/s3 --address :1001 >$PWD/minio.log 2>&1 &
  • 开机启动

    1. chmod a+x /etc/rc.d/rc.local
    2. # minio要用绝对路径
    3. echo "MINIO_ROOT_USER=minio MINIO_ROOT_PASSWORD=minio123 $PWD/minio --compat server $PWD/s3 --address :8888 >$PWD/minio.log 2>&1 &" >> /etc/rc.d/rc.local

    grafana + minio-s3

    采用 s3 + minio 方式图片上传失败 错误 could not find bucket setting for image.uploader.s3

配置 s3 保存截图

  1. #################################### External image storage ##########################
  2. [external_image_storage]
  3. # Used for uploading images to public servers so they can be included in slack/email messages.
  4. # you can choose between (s3, webdav, gcs, azure_blob, local)
  5. provider = s3
  6. [external_image_storage.s3]
  7. endpoint = https://oss-cn-shanghai-internal.aliyuncs.com
  8. ;path_style_access =
  9. bucket = appbak2019
  10. region = oss-cn-shanghai
  11. ;path =
  12. access_key = 密钥
  13. secret_key = 密钥

本地存储

  1. [external_image_storage]
  2. # Used for uploading images to public servers so they can be included in slack/email messages.
  3. # you can choose between (s3, webdav, gcs, azure_blob, local)
  4. provider = local

使用

采用local 模式时,imageURL 参数的值为 http://localhost:3000/public/img/attachments/YSrx5udqcS4E31e3e2cR.png
其中 localhost 由 server 段配置
图片保存在 grafana-storage/png/ 目录中