From 0594ccd30d4f8a433cb8843a4dae69c8c592052b Mon Sep 17 00:00:00 2001 From: Anthony Verez Date: Tue, 6 May 2014 10:00:56 -0700 Subject: [PATCH] averez-docker: fix the workers config --- docker/Dockerfile | 8 +++++--- docker/conf/supervisor.conf | 34 +++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 906c94a1..09cc1e41 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -35,6 +35,7 @@ RUN apt-get install -q -y openjdk-7-jre # rabbit mq RUN apt-get install -q -y rabbitmq-server +RUN rabbitmq-plugins enable rabbitmq_management # mongodb RUN apt-get install -q -y mongodb # nodejs @@ -46,7 +47,7 @@ ADD conf/nginx.conf /etc/nginx/ #Mozdef -RUN (apt-get install -q -y python2.7-dev python-pip curl supervisor\ +RUN (apt-get install -q -y python2.7-dev python-pip curl supervisor wget\ # && curl -L https://github.com/jeffbryner/MozDef/archive/master.tar.gz |tar -C /opt -xz \ # && /bin/ln -s /opt/MozDef-master /opt/MozDef \ && curl -L https://github.com/netantho/MozDef/archive/averez-docker.tar.gz |tar -C /opt -xz \ @@ -56,10 +57,11 @@ RUN (apt-get install -q -y python2.7-dev python-pip curl supervisor\ && mkdir /var/log/mozdef \ && mkdir -p /run/uwsgi/apps/ \ && touch /run/uwsgi/apps/loginput.socket && chmod 666 /run/uwsgi/apps/loginput.socket \ - && touch /run/uwsgi/apps/rest.socket && chmod 666 /run/uwsgi/apps/rest.socket) + && touch /run/uwsgi/apps/rest.socket && chmod 666 /run/uwsgi/apps/rest.socket \ + && mkdir -p /home/mozdef/envs/mozdef/bot/ && cd /home/mozdef/envs/mozdef/bot/ \ + && wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz && gzip -d GeoLiteCity.dat.gz) ADD conf/supervisor.conf /etc/supervisor/conf.d/supervisor.conf - # elasticsearch RUN (curl -L https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.tar.gz | tar -C /opt -xz \ && /bin/ln -s /opt/elasticsearch-1.0.1 /opt/elasticsearch \ diff --git a/docker/conf/supervisor.conf b/docker/conf/supervisor.conf index ba5f8ad8..c9bb3369 100644 --- a/docker/conf/supervisor.conf +++ b/docker/conf/supervisor.conf @@ -49,12 +49,14 @@ command=/usr/local/bin/uwsgi --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root --pp /opt/MozDef/rest --chmod-socket + --logto /var/log/mozdef/uwsgi.rest.log user=root group=root directory=/opt/MozDef/rest umask=022 #[program:alertWorker] +#priority=5 #command=/usr/local/bin/uwsgi # --loop gevent # --socket /run/uwsgi/apps/alertWorker.socket @@ -62,23 +64,29 @@ umask=022 # --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root # --pp /opt/MozDef/mq # --chmod-socket +# --logto /var/log/mozdef/uwsgi.alertWorker.log #user=root #group=root #directory=/opt/MozDef/mq #umask=022 -#[program:esworker] -#command=/usr/local/bin/uwsgi -# --loop gevent -# --socket /run/uwsgi/apps/esworker.socket -# --wsgi-file esworker.py -# --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root -# --pp /opt/MozDef/mq -# --chmod-socket -#user=root -#group=root -#directory=/opt/MozDef/mq -#umask=022 +[program:esworker] +priority=5 +command=/usr/local/bin/uwsgi + --loop gevent + --socket /run/uwsgi/apps/esworker.socket + --mule=esworker.py + --mule + --buffer-size 32768 --master --async 5 --enable-threads --listen 100 --uid root + --pp /opt/MozDef/mq + --stats 127.0.0.1:9192 + --logto /var/log/mozdef/uwsgi.esworker.log + --master-fifo /run/uwsgi/apps/esworker.fifo + --py-auto-reload=30s +user=root +group=root +directory=/opt/MozDef/mq +umask=022 [program:meteor] priority=6 @@ -90,5 +98,5 @@ directory=/opt/MozDef/meteor priority=10 command=python inject.py directory=/opt/MozDef/examples/es-docs/ - +startretries=10