无法在AWS Elastic Beanstalk中创建环境?

时间:2016-01-24 11:20:14

标签: django amazon-web-services elastic-beanstalk

我做了一个小的Django应用程序;我想在AWS上部署它。我按照命令here进行了操作。现在当我eb create时,它没有说

ERROR: Your requirements.txt is invalid. Snapshot your logs for details. ERROR: [Instance: i-05fde0dc] Command failed on instance. Return code: 1 Output: (TRUNCATED)...) File "/usr/lib64/python2.7/subprocess.py", line 540, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command '/opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt' returned non-zero exit status 1. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py failed. For more detail, check /var/log/eb-activity.log using console or EB CLI. INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].

详细日志为here。我在postgresql中的数据库,为此我必须运行单独的RDS实例吗? 我的config.yml
branch-defaults: master: environment: feedy2-dev group_suffix: null global: application_name: feedy2 default_ec2_keyname: aws-eb default_platform: Python 2.7 default_region: us-west-2 profile: eb-cli sc: git
我的01-django-eb.config

option_settings:
  "aws:elasticbeanstalk:application:environment":
    DJANGO_SETTINGS_MODULE: "feedy2.settings"
    PYTHONPATH: "/opt/python/current/app/feedy2:$PYTHONPATH"
  "aws:elasticbeanstalk:container:python":
    WSGIPath: "feedy2/feedy2/wsgi.py"

container_commands:
  01_migrate:
    command: "django-admin.py migrate"
    leader_only: true

我的目录结构: . ├── feedy2 │   ├── businesses │   │   │   ├── customers │   │  │   ├── db.sqlite3 │   ├── feedy2 │   │   ├── __init__.py │   │   ├── __init__.pyc │   │   ├── settings.py │   │   ├── settings.pyc │   │   ├── urls.py │   │   ├── urls.pyc │   │   ├── wsgi.py │   │   └── wsgi.pyc │   ├── manage.py │   ├── questions │   │   │   ├── static │   ├── surveys │   └── templates ├── readme.md └── requirements.txt

1 个答案:

答案 0 :(得分:1)

您截断了输出的相关部分,但它位于pastebin链接中:

Collecting psycopg2==2.6.1 (from -r /opt/python/ondeck/app/requirements.txt (line 20))
 Using cached psycopg2-2.6.1.tar.gz
  Complete output from command python setup.py egg_info:
  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'
  warning: manifest_maker: standard file '-c' not found

  Error: pg_config executable not found.

您需要安装postgresql [version] -devel包。将以下内容放入.ebextensions/packages.config'

packages:
  yum:
    postgresql94-devel: []

来源:Psycopg2 on Amazon Elastic Beanstalk