【问题标题】:how to update pg_dump on Elastic Beanstalk如何更新 Elastic Beanstalk 上的 pg_dump
【发布时间】:2014-12-24 10:55:18
【问题描述】:

我正在尝试导出我的 rds postgresql 数据库。我正在使用弹性豆茎。 sudo yum install postgresql 在我的 ec2 实例上安装版本 9.2-1.20。 RDS 使用 9.3 版,所以我无法运行 pg_dump 有没有办法在我的 ec2 实例上安装 9.3 版的 postgresql(或只是 pg_dump)?欢迎任何提示。

【问题讨论】:

    标签: postgresql amazon-web-services amazon-ec2 amazon-elastic-beanstalk amazon-rds


    【解决方案1】:

    假设您使用的是 amazon linux ami,请发出以下命令以安装 postgresql 9.3:

    $ yum install http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm $ yum install postgresql93-server postgresql93-contrib

    那么版本应该是 9.3.5:
    $ pg_basebackup -V pg_basebackup (PostgreSQL) 9.3.5

    更新:
    Amazon 存储库当前不包含 postgresql 9.3,因此您不能在机器上 yum update 您的 postgresql。 我通过手动安装解决了这个问题。这是我从文档中遵循的步骤:
    sudo yum install -y bison-devel readline-devel zlib-devel openssl-devel wget sudo yum groupinstall -y 'Development Tools' wget ftp://ftp.postgresql.org/pub/source/v9.3.2/postgresql-9.3.2.tar.bz2 bzip2 -d postgresql-9.3.2.tar.bz2 tar -xvf postgresql-9.3.2.tar cd postgresql-9.3.2 ./configure gmake sudo gmake install

    现在你有/usr/local/pgsql/bin/pg_dump

    我向亚马逊发送了一张支持票。他们回复时会更新。

    更新 2:
    以下是亚马逊支持的回复: 1.显示当前版本:
    rpm -qa | grep postgres
    2. 删除它:
    rpm -e postgresql92-libs-9.2.9-1.46.amzn1.x86_64 postgresql92-9.2.9-1.46.amzn1.x86_64 postgresql92-devel-9.2.9-1.46.amzn1.x86_64
    3. yum list postgresql93
    4. yum 安装 postgresql93.x86_64
    5.然后显示当前版本:
    rpm -qa | grep postgres
    postgresql93-libs-9.3.5-1.52.amzn1.x86_64
    postgresql93-9.3.5-1.52.amzn1.x86_64

    【讨论】:

    • 使用第二个命令我收到以下错误:http://yum.postgresql.org/9.3/redhat/rhel-2014.03-x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found" Trying other mirror
    • 你用的是什么ami?在此之前也尝试 yum 更新。这些命令在 amazon linux 上对我有用
    • 感谢@Tal 的帮助。我在.elasticbeanstalk/configSolutionStack=64bit Amazon Linux 2014.03 v1.0.7 running Ruby 2.1 (Passenger Standalone)中有以下设置
    • 我可能还提到我在尝试您提到的命令之前运行了yum update
    • 我用我为使 pg_dump 工作而采取的确切步骤更新了答案
    猜你喜欢
    • 2013-12-18
    • 2014-12-18
    • 2013-12-18
    • 2013-09-18
    • 1970-01-01
    • 2021-07-31
    • 2019-01-04
    • 2016-10-19
    • 2017-04-07
    相关资源
    最近更新 更多