Tag: supervisord

Supervisord haproxy重新加载不工作

我将我的应用程序部署在一个由Supervisorpipe理的进程的Docker容器中。 当我的Zookeeper中的服务器列表发生变化时,我正在重载容器中运行Haproxy(通过sudo haproxy重新加载)。 问题是,Supervisor立即重新启动一个旧configuration的过程,因此不会使更改生效。 1)我试过supervisorctl重读,但我想重新加载(而不是必须重新启动),以避免宕机。 2)我也考虑使用数据包redirect来重启Haproxy,但目前Docker中Iptables的使用受到限制(根据https://github.com/docker/docker/issues/4424#和https:// github .com / docker / docker / issues / 4556 ) 任何build议将不胜感激!

为什么uWSGI无法在Docker中启动?

我使用uWSGI服务Python应用程序相对来说比较新,我试图用一个vassal在emperor模式下启动一个uWSGI进程,但是每次我尝试使用以下命令(以root身份)在Docker内部启动uWSGI时: # /usr/local/bin/uwsgi –ini /etc/uwsgi/emperor.ini 我得到的回应是: [uWSGI] getting INI configuration from /etc/uwsgi/emperor.ini 2.0.13.1 emperor.iniconfiguration文件如下所示: # files/etc/uwsgi/emperor.ini [uwsgi] emperor = /etc/uwsgi/apps-enabled die-on-term = true log-date = true 而唯一的封臣的configuration看起来像: # files/etc/uwsgi/apps-enabled/application.ini [uwsgi] app_dir = /var/www/server plugin = python master = true callable = app chdir = %(app_dir) mount = /=%(app_dir)/start.py protocol = uwsgi socket = :8079 uid […]

WARN日志级别启用时,Supervisor不会收集来自应用程序的日志

我有LEMP复合泊坞窗容器,由docker-compose编译。 我需要将我的PHP应用程序中的所有WARNING日志redirect到容器的STDOUTstream; 它只在supervisord loglevel = debug的选项时才起作用: [supervisord] nodaemon=true loglevel=debug 然后,来自PHP应用程序的日志广播到STDOUT: lemp_1 | lemp_1 | 2017-07-11 19:09:29,524 DEBG'php-fpm'标准输出:lemp_1 | [11-Jul-2017 19:09:29]警告:[池www]孩子13说到标准输出:“[2017-07-11 19:09:29] app.NOTICE:hello world [] []” 如果我把参数设置成supervisord部分[supervisord] loglevel=warn (或信息,错误,警报等..)我没有在我的标准输出stream日志! 我只需要传递活动日志消息,具有WARN级别和更高。 如何supervisord “理解”,它从应用程序收到什么级别的日志消息? 可能是有什么规格的日志消息格式? 或者没有足够的设置? 主pipeconfiguration: [program:php-fpm] command=php-fpm -F autostart=true autorestart=true priority=5 stdout_events_enabled=true stderr_events_enabled=true redirect_stderr=true [program:nginx] command=nginx -g 'daemon off;' autostart=true autorestart=true priority=10 stdout_events_enabled=true stderr_events_enabled=true redirect_stderr=true [supervisord] […]

退出:scrapy(退出状态0;不是预期的)

我尝试运行在我的Docker容器中启动许多蜘蛛的bash脚本。 我的supervisor.conf放在“ /etc/supervisor/conf.d/ ”里,就像这样: [program:scrapy] command=/tmp/start_spider.sh autorestart=false startretries=0 stderr_logfile=/tmp/start_spider.err.log stdout_logfile=/tmp/start_spider.out.log 但主pipe返回这个错误: 2015-08-21 10:50:30,466 CRIT Supervisor以超级用户身份运行(configuration文件中没有用户) 2015-08-21 10:50:30,466 WARN在parsing过程中包含额外的文件“/etc/supervisor/conf.d/tor.conf” 2015-08-21 10:50:30,478信息RPC接口“主pipe”已初始化 2015-08-21 10:50:30,478 CRIT服务器'unix_http_server'在没有任何HTTPauthentication检查的情况下运行 2015-08-21 10:50:30,478 INFO supervisord从pid 5开始 2015-08-21 10:50:31,481信息产生:'scrapy'与pid 8 2015-08-21 10:50:31,555退出的信息:scrapy(退出状态0;不是预期的) 2015-08-21 10:50:32,557 INFO放弃了:scrapy进入FATAL状态,太多的启动重试太快 我的程序停止运行。 但是,如果我手动运行我的程序,它工作得很好… 如何解决这个问题? 有任何想法吗?

具有newrelic java代理和supervisord的Docker容器在首次启动时不发送数据

我们有一个Docker容器,它通过supervisord在tomcat7上运行一个java7应用程序。 我们希望通过newrelic来监控APM。 这是supervisordconfiguration文件 [program:tomcat] command=/home/ec2-user/tomcat7/bin/catalina.sh run environment=CATALINA_OPTS=" -javaagent:/home/ec2-user/tomcat7/newrelic/newrelic.jar" 这里是我们在Dockerfile中添加newrelic.ymlconfiguration文件的地方 COPY newrelic.yml /home/ec2-user/tomcat7/newrelic/newrelic.yml docker集装箱启动时,它运行supervisord,它正确启动Java应用程序。 虽然,如果我们连接到容器并转到tomcat7/newrelic文件夹,我们看不到创build的logs文件夹。 没有数据发送到新的,即使ps aux | grep tomcat ps aux | grep tomcat向我们展示了 -javaagent选项已正确传递: /usr/bin/java -Djava.util.logging.config.file=/home/ec2-user/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -javaagent:/home/ec2-user/tomcat7/newrelic/newrelic.jar -Djava.endorsed.dirs=/home/ec2-user/tomcat7/endorsed -classpath /home/ec2-user/conf:/home/ec2-user/tomcat7/bin/bootstrap.jar:/home/ec2-user/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/home/ec2-user/tomcat7 -Dcatalina.home=/home/ec2-user/tomcat7 -Djava.io.tmpdir=/home/ec2-user/tomcat7/temp org.apache.catalina.startup.Bootstrap start 如果我们杀死容器中的tomcat7进程,supervisord会重新启动进程,然后我们看到“logs”文件夹出现,数据正确地发送到新的。 是否有任何理由为什么第一次supervisord开始的过程中,newrelic代理不附加,但在第二次启动呢? supervisord版本:3.1.3 newrelic代理版本:3.21.0 tomcat版本:7 java版本:7 docker版本:1.7.1

脚本后不能返回到shell会话

我不能得到一个脚本返回到bash。 该脚本通过以下Docker指令启动: ENTRYPOINT ["/bin/bash", "-c"] CMD ["set -e && /config/startup/init.sh"] 初始化脚本如下所示: #!/bin/bash if [ -d /etc/postfix/init.d ]; then for f in /etc/postfix/init.d/*.sh; do [ -f "$f" ] && . "$f" done fi echo "[x] Starting supervisord …" /usr/bin/supervisord -c /etc/supervisord.conf bash 这是我用来启动映像到一个容器的命令: docker run -it –env-file ENV_LOCAL mailrelay 初始化脚本按预期运行(我可以看到/etc/postfix/init.d/目录下的脚本输出,并且supervisord启动了Postfix。 问题是让脚本返回到父进程(bash)而不是需要启动一个新的。 在点击supervisord ,会话就在那里,需要一个Ctrl + C来让它回到bash提示符。 如果我在init.sh脚本结束时不init.sh […]

如何使用supervisor在docker容器上运行elasticsearch?

我遇到了一些在基于debian的容器上运行elasticsearch的问题,这是一个无法find日志文件并且不能以root身份运行的组合 。 但即使symlinking的configuration文件不适合我。 我能够得到它运行,认为这可能是有帮助的。 我用这个命令安装了elasticsearch: wget -qO – https://packages.elastic.co/GPG-KEY-elasticsearch | apt-key add – \ && echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list \ && apt-get update \ && apt-get install -y elasticsearch \ && update-rc.d elasticsearch defaults 95 10

uWSGI通过Docker的Supervisord服务应用程序

我正尝试从Docker中为uWSGI提供一个Django应用程序。 我使用supervisord在Dockerfile的结尾处为我启动进程。 当我运行图像时,它说uWSGI进程启动并成功,但我无法在我认为会显示的URL上查看该应用程序。 也许我没有正确的设置/configuration的东西? 我现在没有supervisord启动nginx,因为我目前正在通过Amazon S3提供静态文件,并且希望首先关注如何让wsgi启动并运行。 我成功地使用uwsgi在本地运行uwsgi –init uwsgi.ini:local来运行应用程序,但我无法将它移到docker中。 这是我的Dockerfile FROM ubuntu:14.04 # Get most recent apt-get RUN apt-get -y update # Install python and other tools RUN apt-get install -y tar git curl nano wget dialog net-tools build-essential RUN apt-get install -y python3 python3-dev python-distribute RUN apt-get install -y nginx supervisor # Get Python3 […]

Docker – 在一个容器中处理多个服务

我想在我的Docker容器中启动两个不同的服务,并在其中一个退出时退出容器。 我看着主pipe,但是一旦托pipe的应用程序退出,我找不到如何让它退出。 它试图重新启动三次,就像标准设置,然后就坐在那里什么都不做。 主pipe能够做到这一点,或者有没有其他的工具呢? 如果还有一种方法可以让两个托pipe程序写入标准输出,标记为应用程序名称,则可以获得奖励,例如: [Program 1] Some output [Program 2] Some other output [Program 1] Output again

Docker:supervisord不会启动uwsgi

Dockerfile FROM ubuntu:14.04.2 RUN rm /bin/sh && ln -s /bin/bash /bin/sh RUN apt-get -y update && apt-get upgrade -y RUN apt-get install supervisor python build-essential python-dev python-pip python-setuptools -y RUN apt-get install libxml2-dev libxslt1-dev python-dev -y RUN apt-get install libpq-dev postgresql-common postgresql-client -y RUN apt-get install openssl openssl-blacklist openssl-blacklist-extra -y RUN apt-get install nginx -y […]