English 中文(简体)
Deploy Postgres11 to Elrmal Beanstalk - required /etc/redhat-releases
原标题:Deploy Postgres11 to Elastic Beanstalk - Requires /etc/redhat-release

我有一把我的第一 app部署到埃尔雷尔·班兰普拉克的时间,可以真正使用一些帮助。 我无法得到邮政局的正式支持而安装。

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: ...

我相信,我需要补充一下吗? 公平够了。 接下来,我试图像我在互联网上的其他岗位上发现的那样,增加回响:

[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

www.un.org/Depts/DGACM/index_spanish.htm 页: 1 页: 1 I ve Trial symlinking etc/system-release -> /etc/redhat-release with no luck. 似乎没有人存在这一问题? 出于某种原因,我似乎还没有经过审查的<条码>。

Environment

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


<><>>.ebextensions/ Packages.config

packages:
  yum:
    postgresql11-devel: []

<><>查询>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
最佳回答

我与PogreSQL 10在AWS Elrmal Beanstalk的Django 2.1项目中的问题一样。

上周,在2019年4月17日左右提出了这一问题,以确保操作系统是实际的红外释放(亚马孙湖没有这种释放)。 我发现有关邮递清单的一些细节:

"Amazon Linux support was removed years ago actually. I just made sure that our repo file reflects that."
(BUG #15768: Removed rpms and now require /etc/redhat-release)

邮寄名单上的1个邮局建议如下:

"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."

从个人角度讲,我与你斯科特一样,我一遍只是回到了信使协会直接提供的9.6客户包。 只要Django和Seccopg支持释放,就可处以罚款。

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

问题回答

Alternatively, you can build posgresql from source:

<代码>wget https://ftp.postgresql.org/pub/source/v11.5/postgresql-11.5.tar.gz

tar zxvf postgresql-11.5.tar.gz

<编码>cd postgresql-11.5

./configure --without-readline

PostgreSQL 尚未从亚马孙获得11份土地,但邮政局10份。 http://www.un.org/Depts/DGACM/index_chinese.htm 为了便于安装:

$ sudo amazon-linux-extras enable postgresql10

如果你能够提供这笔额外资金,你就会看到通过古董提供的许多邮袋,通常可以安装:

$ yum list postgresql*
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Installed Packages
postgresql.x86_64                    10.4-5.amzn2.0.2    @amzn2extra-postgresql10
postgresql-devel.x86_64              10.4-5.amzn2.0.2    @amzn2extra-postgresql10
postgresql-libs.x86_64               10.4-5.amzn2.0.2    @amzn2extra-postgresql10
Available Packages
postgresql-contrib.x86_64            10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-docs.x86_64               10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-libs.i686                 10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-plperl.x86_64             10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-plpython.x86_64           10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-plpython3.x86_64          10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-pltcl.x86_64              10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-server.x86_64             10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-static.x86_64             10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-test.x86_64               10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-test-rpm-macros.x86_64    10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-upgrade.x86_64            10.4-5.amzn2.0.2    amzn2extra-postgresql10
postgresql-upgrade-devel.x86_64      10.4-5.amzn2.0.2    amzn2extra-postgresql10

Here is my maverick solution for the latest Amazon Linux 2 ami:

sudo su
cd /etc/yum.repos.d
nano pgdg.repo

然后,我用新创建的猪肉把这 past在纳米编辑中。 邮袋档案:

[pgdg11]
name=PostgreSQL 11 $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7.5-x86_64
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-11

其他指挥机构是:

sed -i "s/rhel-$releasever-$basearch/rhel-7.5-x86_64/g" "/etc/yum.repos.d/pgdg.repo"
yum groupinstall "PostgreSQL Database Server 11 PGDG"

建立新的邮政数据库组:

/usr/pgsql-11/bin/postgresql-11-setup initdb

现在执行以下指挥,以开始并促成邮政服务:

systemctl enable postgresql-11
systemctl start postgresql-11

Still, keep in mind the notes at this address: Link to Postgresql.org

www.un.org/Depts/DGACM/index_spanish.htm 我没有做什么:。

  1. Postgre10 and above is not available on Amazon Linux 2.
  2. Amazon-linux-extras is not available on (public.ecr.aws/lambda/python:3.11) python3.11 lambda image for Amazon Linux 2. So you cant use this library to install Postgres in python3.11 (python3 more preferably) lambda image for Amazon Linux 2

www.un.org/Depts/DGACM/index_spanish.htm 对我的工作:(在postgres11>上,public.ecr.aws/lambda/python:3.11),但底线是Amazonlav 2,因此适用于使用AL2-EC2、Elgal Beankstal/code>的所有情况。

http://www.hchr.org。

FROM public.ecr.aws/lambda/python:3.11.2023.08.02.09-x86_64
# install dependencies
RUN yum -y groupinstall "Development Tools"
RUN yum -y update
RUN echo -e "
[pgdg11] 

name            = PostgreSQL 11 $releasever - $basearch 

baseurl         = https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7.5-x86_64 

enabled         = 1 

gpgcheck        = 0 

" > /etc/yum.repos.d/pgdg.repo

RUN sed "s/rhel-$releasever-$basearch/rhel-7.5-x86_64/g" "/etc/yum.repos.d/pgdg.repo"
RUN yum groupinstall "PostgreSQL Database Server 11 PGDG" -y
RUN yum install postgresql11 postgresql11-server -y
COPY systemctl.py /usr/bin/systemctl
RUN chmod a+x /usr/bin/systemctl
RUN systemctl enable postgresql11
RUN systemctl start postgresql11
RUN export PATH=/usr/pgsql-11/bin/psql:$PATH

现在,你需要在同一名录中建立一个名为<代码> 系统ctl.py的文档,并抄录

Reference: this article

Just use docker:

sudo yum install docker

sudo systemctlstart docker

sudo docker run --name some-postgres -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=your_password -e POSTGRES_DB=virtual_office -p 5432:5432 -d postgres

一旦完成这项工作。 进入服务器:5432





相关问题
摘录数据

我如何将Excel板的数据输入我的Django应用? I m将PosgreSQL数据库作为数据库。

Postgres dump of only parts of tables for a dev snapshot

On production our database is a few hundred gigabytes in size. For development and testing, we need to create snapshots of this database that are functionally equivalent, but which are only 10 or 20 ...

How to join attributes in sql select statement?

I want to join few attributes in select statement as one for example select id, (name + + surname + + age) as info from users this doesn t work, how to do it? I m using postgreSQL.

What text encoding to use?

I need to setup my PostgreSQL DB s text encoding to handle non-American English characters that you d find showing up in languages such as German, Spanish, and French. What character encoding should ...

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT * ...