Elastic Beanstalk无法安装包

Sur*_*rya 7 python django amazon-ec2 amazon-web-services amazon-elastic-beanstalk

我正在尝试在AWS Elastic Beanstalk上部署我的应用程序.我收到此错误,完全无法查看问题所在.

以下是代码中的代码 .ebextensions/mysite-env.config

packages:
  yum:
    python-devel: []
    postgresql-devel: []

container_commands: 
  01_syncdb:
    command: "django-admin.py syncdb --noinput"
    leader_only: true
  02_createadmin: 
    command: "scripts/createadmin.py"
    leader_only: true

option_settings: 
  - option_name: WSGIPath
    namespace: "aws:elasticbeanstalk:container:python"
    value: "mysite/wsgi.py"
  - option_name: DJANGO_SETTINGS_MODULE
    value: "mysite.settings"
Run Code Online (Sandbox Code Playgroud)

经过几次尝试,我发现了一些东西

  1. 上面的配置文件似乎requirements.txt在root 之后运行
  2. 无法安装这些软件包(如上所述)但我可以通过进入sshEC2实例来安装(奇怪)

问题[1]是,为了psycopg2安装,我需要上面提到的包.那么,我该如何先安装它们呢?

当我运行这些设置时,我收到以下错误:

[2014-11-19T09:45:19.819Z] INFO  [6703]  - [CMD-AppDeploy/AppDeployStage0/EbExtensionPreBuild] : Activity execution failed, because: command failed with error code 1: Error occurred during build: Yum does not have postgresql-devel available for installation (Executor::NonZeroExitStatus)
Run Code Online (Sandbox Code Playgroud)

然后,我使用了以下设置

包:yum:python-devel:[] apt:postgresql-devel:[]

然后我得到以下错误:

[2014-11-19T09:47:54.271Z] ERROR [6789]  : Command execution failed: [CMD-AppDeploy/AppDeployStage0/EbExtensionPreBuild] command failed with error code 1: Error occurred during build: [Errno 2] No such file or directory (ElasticBeanstalk::ActivityFatalError)
    at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.0/lib/elasticbeanstalk/activity.rb:189:in `rescue in exec'
    ...
caused by: command failed with error code 1: Error occurred during build: [Errno 2] No such file or directory (Executor::NonZeroExitStatus)
Run Code Online (Sandbox Code Playgroud)

当我可以直接安装这些软件包时ssh,自动化问题是什么?我的设置有什么问题?

小智 5

在yum语句中使用postgresql93-devel,因为它们已更新包名称

packages:
  yum:
    python26-devel: []
    postgresql93-devel: []
Run Code Online (Sandbox Code Playgroud)

  • 截至2015年12月,将`python-devel`作为包依赖项给出`Yum在Beanstalk中没有可用于安装的python-devel. (8认同)