2

我是 AWS 的新手,所以请帮助我。我只会写那些可能对我的问题很重要的东西。如果您需要更多信息,请在评论部分写。当我 ping ELB 地址或应用程序地址时,我得到“请求超时”。

服务器:

Instance type: micro
Custom AMI: ami-c37474b7

负载均衡器:

Only HTTP, port 80

以及 RDS、S3、ElastiCache、SQS。

我还使用 S3 来存储 django 的静态文件,这很有效,因为我可以在我的存储桶中看到这些文件。
RDS 和 SQS 也可以。ElastiCache 的问题是超时,这是 libmemcached 触发的,但这不是主要问题。

sg-cced0da3 | 用于 ElasticBeanstalk 环境的安全组。

22 (SSH)    0.0.0.0/0
80 (HTTP)   sg-ceed0da1

sg-ceed0da1 | 在 ELB 创建期间未指定安全组时使用 ELB 创建的安全组 - 修改可能会影响到未来 ELB 的流量

80 (HTTP)   0.0.0.0/0

配置文件

packages: 
  yum:
    libevent: []
    libmemcached: []
    libmemcached-devel: []

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

option_settings:
  - namespace: aws:elasticbeanstalk:container:python
    option_name: WSGIPath
    value: findtofun/wsgi.py
  - option_name: DJANGO_SETTINGS_MODULE
    value: findtofun.settings
  - option_name: AWS_ACCESS_KEY_ID
    value: ...
  - option_name: AWS_SECRET_KEY
    value: ...
  - namespace: aws:elasticbeanstalk:container:python:staticfiles
    option_name: /static/
    value: static/

日志


/var/log/eb-tools.log

  • 2013-06-03 14:52:47,908 [INFO] (27814 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] 脚本成功。
  • 2013-06-03 14:52:47,908 [INFO] (27814 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] 执行脚本:
  • /opt/elasticbeanstalk/hooks/appdeploy/pre/03deploy.py
  • 2013-06-03 14:52:50,019 [INFO] (27814 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] 脚本输出:新的 python 可执行文件
  • /opt/python/run/venv/bin/python2.6
  • 安装

/var/log/httpd/error_log

  • Python/2.6.8 已配置——恢复正常操作
  • [2013 年 6 月 3 日星期一 16:53:06] [错误] 异常 KeyError: KeyError(140672020449248,) 被忽略
  • [Mon Jun 03 14:53:06 2013] [notice] 捕获 SIGTERM,正在关闭
  • [Mon Jun 03 14:53:08 2013] [notice] 启用 suEXEC 机制
    (包装器:/usr/sbin/suexec)
  • [Mon Jun 03 14:53:08 2013] [notice] 摘要:为摘要身份验证生成密钥
  • ...
  • [Mon Jun 03 14:53:08 2013] [notice] 摘要:完成
  • [2013 年 6 月 3 日星期一 14:53:08] [通知] Apache/2.2.22 (Unix) DAV/2 mod_wsgi/3.2
  • Python/2.6.8已配置——恢复正常操作列表项

/opt/python/log/supervisord.log

2013-06-03 04:39:35,544 CRIT Supervisor running as root (no user in config file)  
2013-06-03 04:39:35,650 INFO RPC interface 'supervisor' initialized  
2013-06-03 04:39:35,651 CRIT Server 'unix_http_server' running without any HTTP authentication checking  
2013-06-03 04:39:35,651 INFO supervisord started with pid 3488  
2013-06-03 04:39:36,658 INFO spawned: 'httpd' with pid 3498  
2013-06-03 04:39:37,660 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)  
2013-06-03 04:44:51,265 INFO stopped: httpd (exit status 0)  
2013-06-03 04:44:52,280 INFO spawned: 'httpd' with pid 3804  
2013-06-03 04:44:53,283 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)  
2013-06-03 14:53:06,986 INFO stopped: httpd (exit status 0)  
2013-06-03 14:53:08,000 INFO spawned: 'httpd' with pid 27871  
2013-06-03 14:53:09,003 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)  

/var/log/cfn-init.log

2013-06-03 14:53:05,520 [DEBUG] Running test for command 03_createadmin  
2013-06-03 14:53:05,535 [DEBUG] Test command output:  
2013-06-03 14:53:05,536 [DEBUG] Test for command 03_createadmin passed  
2013-06-03 14:53:05,986 [INFO] Command 03_createadmin succeeded  
2013-06-03 14:53:05,987 [DEBUG] Command 03_createadmin output:  
2013-06-03 14:53:05,987 [DEBUG] No services specified  
2013-06-03 14:53:05,994 [INFO] ConfigSets completed  
2013-06-03 14:53:06,000 [DEBUG] Not clearing reboot trigger as scheduling support is not available  
2013-06-03 14:53:06,292 [DEBUG] CloudFormation client initialized with endpoint   https://cloudformation.eu-west-1.amazonaws.com  
2013-06-03 14:53:06,292 [DEBUG] Describing resource AWSEBAutoScalingGroup in stack  arn:aws:cloudformation:eu-west-1:352769977590:stack/awseb-e-bwrsuih23z-stack/52c9b3c0-cbf6-11e2-ace7-5017c2ccb886  
2013-06-03 14:53:06,489 [DEBUG] Not setting a reboot trigger as scheduling support is not available  
2013-06-03 14:53:06,510 [INFO] Running configSets: Hook-EnactAppDeploy  
2013-06-03 14:53:06,511 [INFO] Running configSet Hook-EnactAppDeploy  
2013-06-03 14:53:06,512 [INFO] Running config Hook-EnactAppDeploy  
2013-06-03 14:53:06,512 [DEBUG] No packages specified  
2013-06-03 14:53:06,512 [DEBUG] No groups specified  
2013-06-03 14:53:06,512 [DEBUG] No users specified  
2013-06-03 14:53:06,513 [DEBUG] No sources specified  
2013-06-03 14:53:06,513 [DEBUG] /etc/httpd/conf.d/01ebsys.conf already exists  
2013-06-03 14:53:06,513 [DEBUG] Moving /etc/httpd/conf.d/01ebsys.conf to /etc/httpd/conf.d/01ebsys.conf.bak  
2013-06-03 14:53:06,513 [DEBUG] Writing content to /etc/httpd/conf.d/01ebsys.conf  
2013-06-03 14:53:06,514 [DEBUG] No mode specified for /etc/httpd/conf.d/01ebsys.conf  
2013-06-03 14:53:06,514 [DEBUG] Running command aclean  
2013-06-03 14:53:06,514 [DEBUG] No test for command aclean  
2013-06-03 14:53:06,532 [INFO] Command aclean succeeded  
2013-06-03 14:53:06,533 [DEBUG] Command aclean output:  
2013-06-03 14:53:06,533 [DEBUG] Running command clean  
2013-06-03 14:53:06,534 [DEBUG] No test for command clean  
2013-06-03 14:53:06,547 [INFO] Command clean succeeded  
2013-06-03 14:53:06,548 [DEBUG] Command clean output:  
2013-06-03 14:53:06,548 [DEBUG] Running command hooks  
2013-06-03 14:53:06,548 [DEBUG] No test for command hooks  
2013-06-03 14:53:19,278 [INFO] Command hooks succeeded  
2013-06-03 14:53:19,279 [DEBUG] Command hooks output: Executing directory: /opt/elasticbeanstalk/hooks/appdeploy/enact/  
Executing script: /opt/elasticbeanstalk/hooks/appdeploy/enact/01flip.py  
Output from script: httpd: stopped  
httpd: started  
httpd RUNNING pid 27871, uptime 0:00:03  

Script succeeded.  
Executing script: /opt/elasticbeanstalk/hooks/appdeploy/enact/09clean.sh  
Output from script:  
Script succeeded.  
4

1 回答 1

0

不知道这是否是正确的答案,但我想当我将 DEBUG = False 放入 settings.py 文件时它会起作用。有人可以澄清这一点。

于 2013-06-03T19:00:29.517 回答