云原生容器内的一次pg_repack排错和解决过程

postgresql的pg_repack 这个cronjob一直执行不了。

排错过程:

  1. 用命令 kubectl describe job pg-repack-scheduler-manual-wv82r -n xxx没有查看用有用信息
  2. 想办法进它启动的pod查看,于是在执行pg_repack.sh命令前,先加一个睡眠时间,如下:
yaml 复制代码
- command:
  - sh
  - -c
  - sleep 60000 && ./pg_repack.sh
  1. run cronjob, 进入其起来后的pod, 手动执行./pg_repack.sh,可以看到报错信息是pg_repack 和postgresal数据库里面的版本不匹配
html 复制代码
pg_repack failed with error: program 'pg_repack 1.4.7' does not match database library 'pg_repack 1.4.8'

解决过程

  1. 将Dockerfile中的pg_repack下载地址改掉

  2. 用podman 重新构建image,并上传到远程仓库.(如果是docker,命令中直接把podman换成docker就行了)

powershell 复制代码
podman build -t gxxx.io/xxx/pg-repack:1.4.8-13.5 .
podman images
podman push gxxx.io/xxx/pg-repack:1.4.8-13.5

注意,如果在执行pg_repack命令时,如:pg_repack --dry-run --table category_aspects,遇到如下错误

ERROR: pg_repack failed with error: You must be a superuser to use pg_repack

此时,可以在命令后面加-k 参数掠过superuser检查pg_repack --dry-run --table category_aspects -k

相关推荐
分布式存储与RustFS7 小时前
模型 checkpoint 放对象存储:分片上传、断点续传与残留清理
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
分布式存储与RustFS11 小时前
用RustFS给Harbor当S3存储后端
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
分布式存储与RustFS13 小时前
DPU卸载纠删码与加密:解决AI对象存储的CPU瓶颈
云原生·开源·对象存储·分布式存储·s3·rustfs·性能基准
kuroomi13 小时前
非云原生应用监控
云原生
分布式存储与RustFS16 小时前
自托管对象存储的三种 TLS 签发:自签、Let‘s Encrypt、内网 CA 的选择与轮换
运维·云原生·开源·对象存储·分布式存储·s3·性能基准
分布式存储与RustFS17 小时前
把现有 S3 工具链直接接到 RustFS:100% 兼容到底覆盖哪些 API
云原生·开源·对象存储·分布式存储·s3·rustfs·性能基准
2601_9622190117 小时前
操作日志全留存架构:万象生鲜系统生鲜业务合规审计底层实现方案
微服务·云原生·架构
分布式存储与RustFS18 小时前
AI 训练大文件 Range 读爆炸?RustFS 前面挂一层 Cachey
缓存·云原生·开源·对象存储·分布式存储·ai训练·s3
旋生万物18 小时前
用螺旋数重写 Transformer Attention:让大模型自带“相位记忆“的 PyTorch 实现
docker·云原生·kubernetes·螺旋生成论·螺旋相位
运维开发王义杰19 小时前
有了 TCP,为何还要 HTTP/2 流控?
云原生