将Postgres11部署到Elastic Beanstalk-需要/ etc / redhat-release [英] Deploy Postgres11 to Elastic Beanstalk - Requires /etc/redhat-release

查看:364
本文介绍了将Postgres11部署到Elastic Beanstalk-需要/ etc / redhat-release的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很费劲地将我的第一个应用程序部署到Elastic Beanstalk,并且真的可以使用一些帮助。虽然RDS正式支持Postgres11,但我无法安装它。

I'm having a hell of a time deploying my first app to Elastic Beanstalk and could really use some help. I cannot get Postgres11 to install though it is officially supported with RDS.

问题

如果我运行 eb deploy 我收到一条消息,说找不到 pg_config 可执行文件。需要从源代码构建 psycopg2

ISSUE
If I run eb deploy I get the message saying pg_config executable not found. It is required to build psycopg2 from source.

/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
  warnings.warn(msg)
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'

Error: pg_config executable not found.

pg_config is required to build psycopg2 from source.  Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option: ...

我想我需要添加回购吗?很公平。接下来,我尝试添加回购邮件,就像我在互联网上的其他帖子中找到的一样:

I suppose I'll need to add the repo? Fair enough. Next I try adding the repo as I have found in other posts across the internet:

[ec2-user@ip-... etc]$ sudo yum -y install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
Loaded plugins: priorities, update-motd, upgrade-helper
pgdg-centos11-11-2.noarch.rpm                                          | 5.6 kB  00:00:00     
Examining /var/tmp/yum-root-cQJP_4/pgdg-centos11-11-2.noarch.rpm: pgdg-redhat-repo-42.0-4.noarch
Marking /var/tmp/yum-root-cQJP_4/pgdg-centos11-11-2.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-4 will be installed
--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch
--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-4.noarch
--> Finished Dependency Resolution
Error: Package: pgdg-redhat-repo-42.0-4.noarch (/pgdg-centos11-11-2.noarch)
           Requires: /etc/redhat-release

在这里,我被困住了。符号链接 / etc / system-release-> / etc / redhat-release 没有运气。似乎没有其他人有这个问题吗?由于某种原因,我似乎也没有垂涎的 amazon-linux-extras 吗?

From here I'm stuck. I've tried symlinking /etc/system-release -> /etc/redhat-release with no luck. Nobody else seems to have this problem? I also don't seem to have the coveted amazon-linux-extras for some reason?

环境层: Web服务器

平台:在64位Amazon Linux / 2.8.2上运行的Python 3.6

Environment tier: Web Server
Platform: Python 3.6 running on 64bit Amazon Linux/2.8.2

.ebextensions / packages.config

.ebextensions/packages.config

packages:
  yum:
    postgresql11-devel: []

requirements.txt

requirements.txt

Django==2.2
psycopg2==2.8.2
pytz==2019.1
sqlparse==0.3.0







[ec2-user@ip-... etc]$ cat /etc/os-release 
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

[ec2-user@ip-... etc]$ cat /etc/system-release 
Amazon Linux AMI release 2018.03


推荐答案

我在PostgreSQL 10上有同样的问题一个在AWS Elastic Beanstalk上的Django 2.1项目。

I have the same problem with PostgreSQL 10 for a Django 2.1 project on AWS Elastic Beanstalk.

该问题于2019年4月17日左右引入,以确保操作系统是实际的Red Hat版本(Amazon Linux不是)。我在PostgreSQL邮件列表中找到了一些详细信息:

The issue was introduced last week around 17 Apr 2019 to make sure the operating system is an actual Red Hat release (which Amazon Linux is not). I found some details on the PostgreSQL mailing list:


实际上几年前已删除了Amazon Linux支持。我只是确保了我们的
repo文件反映了这一点。

错误#15768:删除了rpm,现在需要/ etc / redhat-release

邮件列表中的一位张贴者提出了以下解决方案:

One poster on the mailing list suggested the following fix:


我们暂时通过使用rpm并明确地缓解了​​该问题忽略存储库的依赖项,但这似乎是一个针对临时问题的临时解决方案,那就是不应该存在依赖项。

"We have temporarily mitigated the issue by using rpm and explicitly ignoring the repositories dependencies, but that seems like a band-aid fix for the real problem which is that dependency shouldn’t be there."

就个人而言,斯科特,我所做的与您相同,只是恢复了AWS直接提供的PostgreSQL 9.6客户端程序包。只要Django和psycopg支持该版本,就可以正常工作。

Personally, I've done the same as you, Scott, I've simply reverted to the PostgreSQL 9.6 client packages that AWS supplies directly. As long as Django and psycopg support that release, this works fine.

但是,长期的解决方法是使AWS最终为平台提供Amazon Linux 2。

However, the long-term fix is for AWS to finally provide platforms with Amazon Linux 2...

这篇关于将Postgres11部署到Elastic Beanstalk-需要/ etc / redhat-release的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆