我遇到了一个错误,这个错误阻止了我在亚马逊EB上的应用程序(弹性beanstalk启动)...查看日志后,这是唯一一个看起来像有错误的部分...请注意提到的部分MySQL的。
-------------------------------------
/var/app/support/logs/production.log
-------------------------------------
passenger (4.0.20) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
passenger (4.0.20) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
I, [2013-11-25T15:15:27.080960 #10181] INFO -- : Started GET "/" for 212.49.88.109 at 2013-11-25 15:15:27 +0000
F, [2013-11-25T15:15:27.093868 #10181] FATAL -- :
Mysql2::Error (Host 'ip-10-72-151-230.eu-west-1.compute.internal' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'):
mysql2 (0.3.13) lib/mysql2/client.rb:58:in `connect'
mysql2 (0.3.13) lib/mysql2/client.rb:58:in `initialize'
activerecord (4.0.0) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
activerecord (4.0.0) lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/usr/share/ruby/1.9/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/usr/share/ruby/1.9/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
activerecord (4.0.0) lib/active_record/connection_handling.rb:79:in `retrieve_connection'
activerecord (4.0.0) lib/active_record/connection_handling.rb:53:in `connection'
activerecord (4.0.0) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
activerecord (4.0.0) lib/active_record/query_cache.rb:43:in `rescue in call'
activerecord (4.0.0) lib/active_record/query_cache.rb:32:in `call'
activerecord (4.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.0.0) lib/active_support/callbacks.rb:373:in `_run__2745626355944311791__call__callbacks'
activesupport (4.0.0) lib/active_support/callbacks.rb:80:in `run_callbacks'
actionpack (4.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
passenger (4.0.20) lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
passenger (4.0.20) lib/phusion_passenger/request_handler/thread_handler.rb:140:in `accept_and_process_next_request'
passenger (4.0.20) lib/phusion_passenger/request_handler/thread_handler.rb:108:in `main_loop'
passenger (4.0.20) lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'
知道可能出现什么问题吗?该应用程序在本地工作正常(该应用程序在生产时连接到RDS)。
Ps:随意在评论中提问,以便我可以改进我的问题并解释背景。只是不知道目前需要哪些信息。
答案 0 :(得分:0)
我的猜测是你没有为弹性beanstalk环境分配一个安全组来提供对RDS的访问。
http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Overview.RDSSecurityGroups.html