我需要帮助部署Django的web应用程序AWS EB。我的本地开发环境是mac os特立独行。我使用的是django 1.6和virtualenv 1.11.4。如果您能够使用AWS指令进行部署,我真的希望您能分享您的经验以及您为克服障碍所做的不同。AWS弹性魔豆,构建过程中出现错误:命令01_syncdb
[django的AWS](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Python_django.html)
我停留在第6步:更新应用。
我试过的这些工作几个配置文件,并没有:
dgeneric.config:
container_commands:
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: django_generic/wsgi.py
- option_name: DJANGO_SETTINGS_MODULE
value: django_generic.settings
- option_name: AWS_SECRET_KEY
value: SAMPLESECRETxMkk7DTME37PgiEnzA8toans
- option_name: AWS_ACCESS_KEY_ID
value: SAMPLEACCESSDAHRD7A
dgeneric.config版本2:
container_commands:
collectstatic:
command: "django-admin.py collectstatic --noinput"
01syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02migrate:
command: "django-admin.py migrate"
leader_only: true
99customize:
command: "scripts/customize.sh"
You can specify any key-value pairs in the aws:elasticbeanstalk:application:environment namespace and it will be
passed in as environment variables on your EC2 instances
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: "django_generic.settings"
"application_stage": "staging"
"aws:elasticbeanstalk:container:python":
WSGIPath: django_generic/wsgi.py
NumProcesses: 3
NumThreads: 20
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
dgeneric.config版本3:
container_commands:
00_make_executable:
command: "chmod +x scripts/createadmin.py"
leader_only: true
01_syncdb:
command: "django-admin.py syncdb --noinput"
leader_only: true
02_createadmin:
command: "scripts/createadmin.py"
leader_only: true
03_collectstatic:
command: "django-admin.py collectstatic --noinput"
option_settings:
"aws:elasticbeanstalk:container:python:environment":
DJANGO_SETTINGS_MODULE: "django_generic.settings"
"aws:elasticbeanstalk:container:python":
WSGIPath: "django_generic/wsgi.py"
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "static/"
我收到的错误是:
2014-03-19 16:30:09 UTC-0400 INFO Environment update completed successfully.
2014-03-19 16:30:09 UTC-0400 INFO New application version was deployed to running EC2 instances.
2014-03-19 16:30:08 UTC-0400 INFO Command execution completed. Summary: [Successful: 0, Failed: 1].
2014-03-19 16:30:08 UTC-0400 ERROR [Instance: i-3311f412 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 02_createadmin failed .
2014-03-19 16:28:59 UTC-0400 INFO Deploying new version to instance(s).
这里是从只有轻微的更改配置文件不同的尝试错误的另一个片段:
2014-03-19 16:02:57 UTC-0400 INFO Environment update completed successfully.
2014-03-19 16:02:57 UTC-0400 INFO New application version was deployed to running EC2 instances.
2014-03-19 16:02:56 UTC-0400 INFO Command execution completed. Summary: [Successful: 0, Failed: 1].
2014-03-19 16:02:56 UTC-0400 ERROR [Instance: i-3311f412 Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command 01_syncdb failed .
2014-03-19 16:02:49 UTC-0400 INFO Deploying new version to instance(s).
2014-03-19 16:01:52 UTC-0400 INFO Environment update is starting.
从本质上讲,这些错误来自何方配置文件配置错误。你能分享一下你的成功故事吗,或者你是如何在部署中通过这一步的?正如我所看到的,下面的amazon文档不起作用。顺便说一句,我也尝试了下面的例子,它似乎也不适用于我。 http://grigory.ca/2012/09/getting-started-with-django-on-aws-elastic-beanstalk/
我真的很感谢你的帮助。
谢谢,eb日志很有帮助。这应该通过官方的django python在benastalk应用程序中更好地记录。相反,它只是说“查看故障排除” – radtek
使用AWS“查看故障排除”的含义是:将其转到Google,然后阅读StackExchange。 ;) –
有时虽然错误非常糟糕,但eb日志不会返回任何内容,并且从控制台下载日志也不会。服务器也不返回任何答复。当我转换到一个支持geodjango开箱的较旧实例时,我有了这个。发生这种情况时,您必须手动ssh进入EC2实例来检查日志。 – radtek