2017-03-06 208 views
0

因此,我有一個包含Filebeat和一些其他服務的CentOS Docker鏡像,我嘗試使用Supervisor進行管理。作爲Supervisor配置的一部分,我想啓動Filebeat服務。這裏就是我想在supervisord.conf使用Supervisor啓動Filebeat

[program:filebeat] 
command=/etc/init.d/filebeat start 
directory=/etc/init.d/ 
autostart=true 
autorestart=true 

上面的代碼片斷給了我一個錯誤,指出「無法獲取d-bus接口:操作不允許」。

關於什麼是啓動Filebeat的正確方法的想法?

回答

1

我建議在自己的container中運行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告訴以將日誌寫入標準錯誤,因此您可以管理與supervisorctl記錄的過程。

+0

我簡單地繼續在單獨的容器中使用Filebeat,而不是使用Supervisord來避免複雜性。 –