简体   繁体   English

带有Rails App-Workers的Docker未运行

[英]Docker with a Rails App-Workers not running

So I have a Rails Application that has multiple types of workers. 所以我有一个具有多种类型的工作程序的Rails应用程序。 I decided to try and run the rails app with Docker, with a separate image for each type of worker (Resque, DelayedJob, a scheduler, different configurations). 我决定尝试在Docker上运行rails应用,为每种类型的worker(Resque,DelayedJob,调度程序,不同的配置)使用单独的映像。 The problem is that the workers with queues (DelayedJob + Resque) are not picking up jobs (using both to rule out the queuing system itself). 问题在于,具有队列(DelayedJob + Resque)的工作人员没有接管工作(使用这两者来排除排队系统本身)。 I can see the jobs enqueued, they're there, but the workers never pick up anything off the queue. 我可以看到工作已排队,但那里的工作人员从未从队列中捡起任何东西。 If I run a worker off the console, it works just fine. 如果我从控制台上运行一个工作程序,它就可以正常工作。

The images are based on Cedarish- https://github.com/progrium/cedarish 图像基于Cedarish- https://github.com/progrium/cedarish

The web workers that are sitting behind NGINX seem to be doing fine, though I have noticed some issues with them sometimes becoming non-responsive after a while but not sure if that's related. 坐在NGINX后面的网络工作者看起来还不错,尽管我注意到他们的某些问题有时会在一段时间后变得无响应,但不确定是否相关。

Any idea as to what could cause a worker, run under Docker and successfully connecting to Redis + MySQL, to just ignore the job queue and not pick anything up? 关于什么可能导致工作人员在Docker下运行并成功连接到Redis + MySQL的任何想法,只是忽略作业队列并且什么都没捡到,是什么主意?

Guessing this has something to do with my Docker configuration... 猜测这与我的Docker配置有关...

Turns out this was an operating system problem-Docker was running up to 100% CPU usage and just generally misbehaving. 事实证明,这是一个操作系统问题-Docker的CPU使用率高达100%,并且通常行为异常。

This was on a GCE instance with Debian 7 with backports. 这是在带有Backport的Debian 7的GCE实例上。

The following fixed the problem: 以下内容解决了该问题:

sudo aptitude install bridge-utils libvirt-bin debootstrap

vi /etc/default/grub vi / etc / default / grub

GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

sudo reboot

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM