使用Supervisor启动Filebeat
所以我有一个包含Filebeat和一些其他服务的CentOS Docker镜像,我试图用Supervisor进行pipe理。 作为Supervisorconfiguration的一部分,我想启动Filebeat服务。 这是我在supervisord.conf中所要做的
[program:filebeat] command=/etc/init.d/filebeat start directory=/etc/init.d/ autostart=true autorestart=true
上面的代码给我一个错误,说明“无法获得D-Bus连接:操作不允许”。
任何思考什么是正确的方式来启动Filebeat?
我build议在自己的容器中运行Filebeat。 但是,如果你要使用supervisord,那么你不想守护进程。 您将需要使用类似于Filebeat用于systemd的命令 。
command=/usr/share/filebeat/bin/filebeat -e -c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat
-e
告诉进程将其日志写入stderr,以便您可以使用supervisorctl
pipe理日志logging。