Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change docker db driver #5

Merged
merged 37 commits into from
May 31, 2024
Merged

Change docker db driver #5

merged 37 commits into from
May 31, 2024

Conversation

luojiyin1987
Copy link

Closed #2

先用 redis 作为 meta-server 进行测试, redis 停止服务时, metadata就会消失,避免自己再次format 。 不过经过测试 还时报 <FATAL>: Storage wasb://polyfill4web/myjfs/ is not empty; please clean it up or pick another volume name [format.go:485] 的报错。 十分不了解 juicefs 的逻辑。

同时为了 juicefs 可以正常获取释放 fuse, 已经给了 juicefs privileged 权限, 这是一个高危操作, 十分不理解他们的设计。

是否可以更换其他的 S3 类中间件, 挂载网络存储到本地磁盘上?

@luojiyin1987
Copy link
Author

luojiyin1987 commented Apr 20, 2024

image
juicedata/mount:latest 容器已经可以正常运行了
@TechQuery

@TechQuery TechQuery added the feature New Feature or Refactor label Apr 20, 2024
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@luojiyin1987
Copy link
Author

现在是 myjfs 的容器的文件没做持久化, 但 meta-server(postgres)做了数据持久化了。 不知道容器不断启动,是否导致 meta-server 数据混乱,还在测试中。 理想的方案是 myjfs meta-server 都做持久化。 或者 myjfs meta-server 都不做持久化 ,每次都是从新开始。 @TechQuery

@TechQuery
Copy link
Member

现在是 myjfs 的容器的文件没做持久化

JuiceFS 的持久化不就只有元数据和文件本身吗?还有哪些要做持久化?

@luojiyin1987
Copy link
Author

现在是 myjfs 的容器的文件没做持久化

JuiceFS 的持久化不就只有元数据和文件本身吗?还有哪些要做持久化?

现在 myjfs 没做容器内挂载文件的持久化, 重新启停后, 就没文件了。

@luojiyin1987
Copy link
Author

juicedata/juicefs-csi-driver#934
现在把遇到的问题反馈给上游

@luojiyin1987
Copy link
Author

luojiyin1987 commented Apr 26, 2024

我现在越来越倾向用 minio 或者 BlobFuse 替换 juiceFS 。 @TechQuery

@TechQuery
Copy link
Member

BlobFuse

这个不能通用于所有对象存储平台,我们不但是自己用,还要通过 PR 给上游提供通用解决方案。

@luojiyin1987
Copy link
Author

minio 的运维压力有点大, 考虑 rclone

@TechQuery
Copy link
Member

minio 的运维压力有点大, 考虑 rclone

rclone mount

@luojiyin1987
Copy link
Author

minio 的运维压力有点大, 考虑 rclone

rclone mount

https://rclone.org/docker/ 它有完整的介绍文档, 在尝试中

@luojiyin1987
Copy link
Author

@luojiyin1987
Copy link
Author

luojiyin1987 commented May 31, 2024

现在的方案 需要在 Linux 安装 fuse sudo apt install fuse3 。 目前遇到的问题, rclone docker 容器退出后, 不能 umount 目录。当下次启动会出现的报错, Error response from daemon: error while creating mount source path '/home/traefik/Polyfiller/metadata': mkdir /home/traefik/Polyfiller/metadata: file exists 导致 docker compose 启动失败

解决办法 sudo umount -l /home/traefik/Polyfiller/metadata 手动 umount ,就可以正常启动了。

要解决 docker 退出后, 一些清理工作。 @TechQuery

查看文档可以通过 docker compose down --volumes 可以在正常情况下 umount, 但是对应非正常退出,还是要自己手动清理。

docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
config/rclone/rclone.conf Outdated Show resolved Hide resolved
config/rclone/rclone.conf Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
docker-compose.yml Outdated Show resolved Hide resolved
@TechQuery
Copy link
Member

TechQuery commented May 31, 2024

但是对应非正常退出,还是要自己手动清理。

Docker 退出前能否执行 shell 脚本?如果能执行我们自定义的清理逻辑,那下一次启动也就不会报错,也就不会再产生非正常退出了。

  1. Docker 容器 被手动停止, 应该是可以执行 Shell脚本, 还没验证
  2. Docker 进程意外退出,没机会执行 Shell 脚本,需要自己手动维护乐。

@TechQuery TechQuery merged commit faaf1cc into master May 31, 2024
@TechQuery TechQuery deleted the change-docker-db-driver branch May 31, 2024 23:58
@luojiyin1987
Copy link
Author

用 Docker volume 挂载到 rclone 容器内,发现 api-service 是无法写入到 volume 里。 即如下配置

volumes:
      - ./config/rclone:/config/rclone # Mount the local rclone config directory to the container
      - polyfill-cache:/polyfill-cache:shared # Mount the local directory for the rclone mount

后来改成通过本地目录共享的方式解决。有个副作用,docker compose down --volumes 也无法正常 umount, 需要自己手动 umount, 将在下一个迭代解决。 @TechQuery

volumes:
     - ./config/rclone:/config/rclone # Mount the local rclone config directory to the container
     - ./polyfill-cache:/polyfill-cache:shared # Mount the local directory for the rclone mount

volumes:
      - ./polyfill-cache:/tmp/@wessberg/polyfiller

@luojiyin1987
Copy link
Author

接着测试 docker compose down --volumes 是可以正常处理的, 只是 umount 是需要一些时间, 并不是可以马上释放资源的。 @TechQuery

@TechQuery TechQuery self-assigned this Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Feature or Refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

更换 Polyfiller Docker 卷元数据库
3 participants