2012-08-09 17 views
6

Tengo TAKS Capistrano como estedesplegar con Capistrano no

require "bundler/capistrano" 

set :application, "cloudoc" 
set :repository, "[email protected]:luizkowalski/cloudoc.git" 

set :scm, :git 

role :web, "xx.xx.xx.xxx" 
role :app, "xx.xx.xx.xxx" 
role :db, "xx.xx.xx.xxx", :primary => true 

default_run_options[:pty] = true 
ssh_options[:forward_agent] = true 

after "deploy:restart", "deploy:cleanup" 

set :user, "deploy" 
set :use_sudo, true 

set :deploy_to, "/home/deploy" 
set :deploy_via, :remote_cache 

role :web, "xx.xx.xx.xxx" 
role :app, "xx.xx.xx.xxx" 
role :db, "xx.xx.xx.xxx", :primary => true 

después de la cap deploy esta es la salida.
por alguna razón, falla y no sé por qué. Lo he intentado con use_sudo false y con root, sucede lo mismo.

[xx.xx.xx.xxx] executing command 
    command finished in 4714ms 
    copying the cached version to /home/deploy/releases/20120809223144 
    * executing "cp -RPp /home/deploy/shared/cached-copy /home/deploy/releases/20120809223144 && (echo 61eeff328c40e104962f96bf6ffc5150bd1162e4 > /home/deploy/releases/20120809223144/REVISION)" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 604ms 
    * executing `deploy:finalize_update' 
    triggering before callbacks for `deploy:finalize_update' 
    * executing `deploy:assets:symlink' 
    * executing "rm -rf /home/deploy/releases/20120809223144/public/assets &&\\\n  mkdir -p /home/deploy/releases/20120809223144/public &&\\\n  mkdir -p /home/deploy/shared/assets &&\\\n  ln -s /home/deploy/shared/assets /home/deploy/releases/20120809223144/public/assets" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 544ms 
    * executing `bundle:install' 
    * executing "cd /home/deploy/releases/20120809223144 && bundle install --gemfile /home/deploy/releases/20120809223144/Gemfile --path /home/deploy/shared/bundle --deployment --quiet --without development test" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 1990ms 
    * executing "chmod -R g+w /home/deploy/releases/20120809223144" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 1042ms 
    * executing "rm -rf /home/deploy/releases/20120809223144/log /home/deploy/releases/20120809223144/public/system /home/deploy/releases/20120809223144/tmp/pids &&\\\n  mkdir -p /home/deploy/releases/20120809223144/public &&\\\n  mkdir -p /home/deploy/releases/20120809223144/tmp" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 534ms 
    * executing "ln -s /home/deploy/shared/system /home/deploy/releases/20120809223144/public/system" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 517ms 
    * executing "ln -s /home/deploy/shared/log /home/deploy/releases/20120809223144/log" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 519ms 
    * executing "ln -s /home/deploy/shared/pids /home/deploy/releases/20120809223144/tmp/pids" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 521ms 
    triggering after callbacks for `deploy:update_code' 
    * executing `deploy:assets:precompile' 
    * executing "cd /home/deploy/releases/20120809223144 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
** [out :: xx.xx.xx.xxx] Compiled jquery.js (2ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled jquery_ujs.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-transition.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-alert.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-modal.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-dropdown.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-scrollspy.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-tab.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-tooltip.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-popover.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-button.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-collapse.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-carousel.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap/bootstrap-typeahead.js (0ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled twitter/bootstrap.js (247ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled ios-checkboxes/ios-checkboxes.js (20642ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled ios-checkboxes.js (22403ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled rails.validations.js (418ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled best_in_place.js (327ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled autosize.js (76ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled bootstrap.js (5870ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled dashboard.js (1388ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled documents.js (896ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled home.js (377ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled sessions.js (563ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Compiled application.js (51370ms) (pid 1075) 
** [out :: xx.xx.xx.xxx] Killed 
    command finished in 68972ms 
*** [deploy:update_code] rolling back 
    * executing "rm -rf /home/deploy/releases/20120809223144; true" 
    servers: ["xx.xx.xx.xxx"] 
    [xx.xx.xx.xxx] executing command 
    command finished in 612ms 
failed: "sh -c 'cd /home/deploy/releases/20120809223144 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on xx.xx.xx.xxx 

¿Alguna idea?
si alguien necesita más información, por favor hágamelo saber
Gracias de antemano

+0

¿Quizás te has quedado sin memoria? ¿Echó un vistazo a la salida de 'dmesg'? ¿Quizás el asesino OOM acaba de terminar su tarea de rake? – iblue

+0

¿Qué es dmseg? ¿cómo sé si OOM está haciendo esto? –

+2

Simplemente ingrese a su servidor y ejecute 'dmesg' en la terminal. Mostrará los registros del kernel. Si hay alguna referencia al 'OOM killer', se te acabó el RAM. También puedes echar un vistazo a 'free' para ver cuánto RAM hay. – iblue

Respuesta

18

El núcleo mata activamente los procesos de memoria RAM cuando es corto y procesos a utilizar toda la memoria RAM. Puede usar dmesg para ver si el kernel ha matado al proceso. Aparecerán mensajes como este:

[ 3380.091822] Out of memory: Kill process 1075 (ruby1.9.1) score 382 or sacrifice child 

Puede activar el espacio de intercambio o cerrar otros procesos. Si está ejecutando un VPS, asegúrese de tener suficiente memoria RAM disponible. La solución más simple, si los problemas son realmente una escasez de RAM libre, es simplemente comprar más RAM.

1

Si está utilizando una instancia de amazon EC2 micro intente eliminar las versiones anteriores de su aplicación y luego reinicie la instancia del servidor. Esto funcionó para mí. tapa desplegar: limpieza tapa de caucho: reiniciar

8

Estoy ejecutando mi aplicación de rieles en Digital Ocean. Crear un intercambio de 2gb parece resolver el problema.

+0

Estoy en Digital Ocean también, pero ¿qué diablos significa "Crear un intercambio de 2gb"? – Catfish

+0

Catfish, puede agregar fácilmente un espacio de intercambio como este: "dd if =/dev/zero of =/tmp/swap.img bs = 1M count = 1024" Esto creará un archivo vacío en /tmp/swap.ing de 1G. Luego puede llamar a "mkswap /tmp/swap.img" y "swapon /tmp/swap.img" –

0

Me encontré con este error y me di cuenta de que estaba almacenando todos mis lanzamientos anteriores. Simplemente utilicé cap deploy:cleanup y funcionó muy bien.

Cuestiones relacionadas