瘦服务器不工作的生产方式(现场)在Amazon EC2 [英] Thin server not working on Production mode(live) on Amazon Ec2

查看:175
本文介绍了瘦服务器不工作的生产方式(现场)在Amazon EC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Rails应用程序与angularjs作为我的前端。

I am running a rails app with angularjs as my front end.

我刚刚把它推到生产,但是我得到一个非常奇怪的问题。

I have just pushed it to production, however I am getting a very strange issue.

我已经使用既轻薄又Nginx的服务器,因为它是在Amazon EC2(Ubuntu的64位机)。

I have used both thin and Nginx server as it is on Amazon EC2(Ubuntu 64 bit machine).

虽然这样的问题,我得到的是在给定时间(1-5分钟)后,瘦服务器正在停止。这是发生在一个直播现场。

While doing so the issue I am getting is the thin server is stopping after a given amount of time (1-5 mins). This is happening on a live site.

我生成的日志文件如下: -

The log file I am generating is the following:-

>> Thin web server (v1.5.1 codename Straight Razor)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
>> Exiting!
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:578:in `write_nonblock': Broken pipe (Errno::EPIPE)
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:578:in `eventable_write'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:368:in `block in crank_selectables'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:368:in `each'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:368:in `crank_selectables'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:324:in `block in run'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:318:in `loop'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:318:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:62:in `run_machine'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/lib/thin/backends/base.rb:63:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/lib/thin/server.rb:159:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/lib/thin/controllers/controller.rb:86:in `start'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/bin/thin:23:in `load'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/bin/thin:23:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
>> Writing PID to tmp/pids/thin.3000.pid
>> Using rack adapter
You did not specify how you would like Rails to report deprecation notices for your Production environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/Production.rb
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:256: warning: already initialized constant TimerFired
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:258: warning: already initialized constant ConnectionData
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:260: warning: already initialized constant ConnectionUnbound
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:262: warning: already initialized constant ConnectionAccepted
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:264: warning: already initialized constant ConnectionCompleted
/usr/local/rvm/gems/ruby-1.9.3-p484/gems/eventmachine-1.0.3/lib/em/pure_ruby.rb:266: warning: already initialized constant LoopbreakSignalled
        SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
        This poses a security threat. It is strongly recommended that you
        provide a secret to prevent exploits that may be possible from crafted
        cookies. This will not be supported in future versions of Rack, and
        future versions will even invalidate your existing user cookies.

        Called from: /usr/local/rvm/gems/ruby-1.9.3-p484/gems/actionpack-3.2.8/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

下面是我的Gemfile code:

Below is my gemfile code:

source 'https://rubygems.org'

gem 'rails', '3.2.8'
gem 'rake' , '10.1.0'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'


gem 'json','1.8.0'
gem 'thin' ,'1.5.1'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  gem 'therubyracer', '0.10.2', :platforms => :ruby
  gem 'less-rails','2.2.6'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails', :git => 'https://github.com/rails/jquery-rails.git'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
 gem 'capistrano','2.15.5'
gem 'rvm-capistrano' ,'1.4.3'


# To use debugger
# gem 'ruby-debug'

我运行4台服务器上薄的nginx。我尝试了很多东西,但没有什么帮助了我。

I am running 4 servers of thin on nginx. I tried out many things but nothing is helping me.

任何帮助将AP preciated。

Any help will be appreciated.

更新: -

我提出申请,以32bit的Ubuntu的服务器在Amazon EC2上,它似乎是工作的罚款那里。

I have moved the application to 32bit Ubuntu server on Amazon EC2 and it seems to be working fine out there.

我似乎不明白这个问题,但必须把应用程序恢复64位服务器上几天。

I don't seem to understand the issue but have to put the application back on 64bit server in a couple of days.

我看不出与应用程序的任何问题,但不知道为何导致崩溃的64位服务器上。难道是与瘦服务器或宝石的任何问题?

I don't see any issue with the application but don't know why it is crashing on 64bit server. Is it something to do with thin server or any issue with the gems ?

请帮我出这个

推荐答案

试试这个

薄-e生产-d启动

的 - e是对环境 在 - ð允许它在后台运行 当你不使用-d它需要一个开放的终端保持运行。

the - e is for the environment the - d allows it to run in the background when you don't use the -d it requires an open terminal to keep running

我找到了答案在这里 http://articles.slicehost.com / 2008/5/6 / Ubuntu的耐寒薄-web服务器换红宝石

I found the answer here http://articles.slicehost.com/2008/5/6/ubuntu-hardy-thin-web-server-for-ruby

这篇关于瘦服务器不工作的生产方式(现场)在Amazon EC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆