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

使用库调用方式接入 go 服务,能否支持分布式多 pod 得环境 #130

Closed
MrGlp opened this issue Jul 3, 2023 · 2 comments
Closed

Comments

@MrGlp
Copy link
Contributor

MrGlp commented Jul 3, 2023

我看项目中用了一个 db 得库,会生成一个 gopeed.db
我理解这个就是服务挂掉,然后重启之后恢复任务得关键

那么如果我是多 pod 部署了我的 go 服务,使用 go mod 依赖了 go peed 得库去开发
会不会导致 a 用户下载了文件得相关数据只存在于某个 pod 上面

如果我 a 用户首次下载再 pod 1 中

那么我调查询下载详情方法的时候如果请求打到了 pod 2,pod 3 ... 那么就查不到这条记录,必须也要保证 a 用户得查询请求也在 pod 1 才能查到

===========================================================

【1】我上面的认知对么
【2】如果真的存在上面得问题,我这边有没有办法快速改进兼容下

@monkeyWie
Copy link
Member

对的,pod只适用于无状态的服务,目前gopeed依赖本地存储持久化数据,你可以考虑k8s有状态服务部署

@MrGlp MrGlp closed this as completed Jul 4, 2023
@MrGlp
Copy link
Contributor Author

MrGlp commented Jul 4, 2023

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants