简体   繁体   English

升级bitnami postgresql镜像k8s

[英]Upgrade bitnami postgresql image k8s

I was trying to upgrade from bitnami pg image 11 -> version 14. When trying to do so i was prompted with the following error:我试图从 bitnami pg image 11 -> 版本 14 升级。尝试这样做时,我收到以下错误提示:

The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 14.0

In order to get around this, I created a new postgres deployment with a new PVC, used pgdump to take a backup of the data and imported it within the new postgres deployment which is running version 14.为了解决这个问题,我使用新的 PVC 创建了一个新的 postgres 部署,使用 pgdump 备份数据并将其导入到运行版本 14 的新 postgres 部署中。

However I'm going to need to repeat this process on larger databases which terabytes of data and don't think pgdump is going to be sufficient.但是,我将需要在具有 TB 级数据的大型数据库上重复此过程,并且不认为 pgdump 就足够了。

With the bitnami image is it possible to use the likes of pg_upgrade?使用 bitnami 图像是否可以使用 pg_upgrade 之类的东西?

Yeah, backup and restoring the way you did is always a good option with new PVC and PV .是的,使用新的PVCPV备份和恢复您所做的方式始终是一个不错的选择。

Pg_dump & Pg_restore is a robust native option i think you can use the -j to start the multiple threads to migrate the data. Pg_dump & Pg_restore 是一个强大的本机选项,我认为您可以使用-j启动多个线程来迁移数据。

To migrate the TB of data you might need good Network bandwidth and a scalable solution.要迁移 TB 的数据,您可能需要良好的网络带宽和可扩展的解决方案。

Not sure how you are running this instances or replicas.不确定您如何运行此实例或副本。

You can do something like :您可以执行以下操作:

Create new helm release of Postgres while the old one running版本运行时创建Postgreshelm 版本

Migrate the data迁移数据

kubectl exec -it new-helm-db-postgresql-0 -- bash -c 'export PGPASSWORD=${POSTGRES_PASSWORD}; time pg_dump -h old-postgresql -U postgres | psql -U postgres'

As suggested above you can add the -j also to start multi threads however it will increase the resources of POD and Disk usage if migrating TB of data.如上所述,您也可以添加-j来启动多线程,但是如果迁移 TB 数据,它将增加 POD 资源和磁盘使用量。

You can also refer : https://www.citusdata.com/blog/2021/02/20/faster-data-migrations-in-postgres/您也可以参考: https ://www.citusdata.com/blog/2021/02/20/faster-data-migrations-in-postgres/

i would like to suggest using the DMS AWS if you are on the managed cloud.如果您在托管云上,我想建议您使用DMS AWS

Or else setting up one VM with Migration Tool and migrating data to old postgres cluster to new.或者使用迁移工具设置一个虚拟机并将数据迁移到旧的 postgres 集群到新的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 K8s 上的 Postgres:mkdir:无法创建目录“/bitnami/postgresql/data”:初始化 PostgreSQL 数据库时权限被拒绝 - Postgres on K8s: mkdir: cannot create directory ‘/bitnami/postgresql/data’: Permission denied while Initializing PostgreSQL database 本地卷K8上的性能Postgresql - Performance Postgresql on Local Volume K8s 使用 postgresql 在 K8s 中使用超集的配置问题 - Configuration issues with superset in K8s with postgresql 在 K8S 中备份 Postgresql [暂停] - Backup Postgresql in K8S [on hold] 由于用户“bn_jupyterhub”的密码验证失败,k8s 上的 Bitnami jupyterhub 图表失败 - Bitnami jupyterhub charts on k8s failing due to password authentication failed for user "bn_jupyterhub" Postgresql k8s上的数据无法持久化 - Postgresql data on k8s cannot be made persistent 如果我在 k8s 中声明 2 个 PostgreSQL StatefulSet pod 副本,它们是同一个数据库还是只是共享卷? - If I declare 2 replicas of PostgreSQL StatefulSet pods in k8s, are they the same database or they just share the volume? 在具有主从模式的 k8s 中运行 postgresql 的最佳方法是什么? - What is the best way to run postgresql in k8s with master-slave mode? K8s postgres 不持久化数据 - K8s postgres not persisting data 使用 glusterfs 作为存储的 k8s 上的 postgres - postgres on k8s with glusterfs as storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM