Coding One

  • java
  • php
  • python
  • 前端
  • 大数据
  • 操作系统
  • 树莓派
  • 其他
Coding One
如果每天只要敲敲代码,那这样一辈子也挺好。
  1. 首页
  2. python
  3. 正文

Kylin V10 高级服务器docker部署FastGPT时pgvector容器启动失败:popen failure: Cannot allocate memory

2023年12月17日 25533点热度 5人点赞 0条评论

遇到的问题:

环境:Kylin V10 SP2 v2027, Intel i5处理器, 12GB内存

学习使用FastGPT的时候,采用最简单的容器部署。涉及fastgpt、mongo、pgvector三个容器。
容器启动遇到的情况:
popen failure: Cannot allocate memory
initdb: error: program "postgres" is needed by initdb but was not found in the same directory as "/usr/lib/postgresql/15/bin/initdb"

上面的错误导致 ankane/pgvector:v0.5.0 容器一直无法启动。

原因:
最开始以为时内存不足,后来同一台机器,换了windows内的ubuntu(wls),启动就没有问题。可以确定不是硬件资源的问题。
怀疑时基础功能的差异,考虑到popen应该时一个编译过得命令,想着是不是基础环境的问题。

最后找到原因了:pgvector镜像的Dockerfile中可以看出,是from postgres:15
而且经过验证,就算是官方镜像 postgres:15 也无法启动,报错如上。
最后经过资料搜索,发现问题在postgres的版本上,因为postgres对不同的os版本(debian 11, debian 12)有特殊的编译版本,

参考资料:

postgresql - 初始化数据库 : error: program "postgres" is needed by initdb but was not found using circleci ubuntu docker-compose docker-entrypoint-initdb. d

https://github.com/docker-library/postgres/issues/1099#issuecomment-1593228770

最终解决方案:

1. 从pgvector的github上获取它的Dockerfile
2. 修改 pgvector 的 Dockerfile,为 from postgres:15.3-bullseye
3. 然后重新编译自己的pgvector镜像
4. 修改fastgpt项目提供的dockercompose.yml文件,修改其中的pgvector镜像为自己的pgvector镜像
5. 启动 docker-compose up -d

标签: FastGPT initdb kylin pgvector popen Postgres V10
最后更新:2023年12月17日

Wang

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2022 Coding One. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

闽ICP备17024682号