Distributions
› Ubuntu
› Fedora
› CentOS
中文资源站
› 网易开源镜像站
cevincheung
V2EX  ›  Linux

乃们用啥做 Linux 上的 daemon 监控?sphinx 挂了都不知道。 - -#

  •  
  •   cevincheung ·
    cevin · Oct 28, 2014 · 4747 views
    This topic created in 4393 days ago, the information mentioned may be changed or developed.
    很简单,挂了自动重启那种。
    29 replies  •  2014-10-30 06:50:08 +08:00
    bitwing
    bitwing
    Oct 28, 2014
    1
    supervisor 有这种功能的吧
    julyclyde
    julyclyde
    Oct 28, 2014
    2
    init-daemontools
    用SIGCHLD串一串
    frankzeng
    frankzeng
    Oct 28, 2014
    3
    这种对于做运维的太简单了,可以先检测,发现不正常kill掉,然后重启,把这功能做成脚本放到crontab里,5分钟运行一次。
    cevincheung
    cevincheung
    OP
    Oct 28, 2014
    4
    @frankzeng 最好有一个工具会更好吧,比如

    /sbin/daemon-mointer searchd xxxxxxxx
    然后就万事大吉了。
    eriale
    eriale
    Oct 28, 2014
    5
    supervisor可以自动重启挂掉的应用。
    wuxqing
    wuxqing
    Oct 28, 2014
    6
    可以试试monit
    frankzeng
    frankzeng
    Oct 28, 2014
    7
    你要是会用shell,这比工具简单多了。
    20150517
    20150517
    Oct 28, 2014
    8
    @frankzeng 我去,你们运维就是这样不管3721不正常就kill吗?代码发来看看,哈哈
    frankzeng
    frankzeng
    Oct 28, 2014
    9
    @20150517 对于不正常的进程,首先上去就是重启,你别说,重启能解决90%的问题。
    cevincheung
    cevincheung
    OP
    Oct 28, 2014
    10
    @frankzeng 这个我同意,这是能最大化节省运维时间和成本的方法,与其消耗100分钟的时间去查原因,还不如直接花1秒时间重启服务来得快。
    Jaylee
    Jaylee
    Oct 28, 2014
    11
    supervisor
    binux
    binux
    Oct 28, 2014❤️1
    12
    sarices
    sarices
    Oct 28, 2014
    13
    supervisor +1
    est
    est
    Oct 28, 2014
    14
    @frankzeng 直接跑个while true ? 也是个好思路。。。。
    pubby
    pubby
    Oct 28, 2014
    15
    @est while true +1

    写过一个服务,一直跑下去会出现奇葩问题,所以.....自带主动停止功能 ^-^
    bearice
    bearice
    Oct 28, 2014
    16
    daemontools拯救世界(不是那个虚拟光驱)
    ryd994
    ryd994
    Oct 29, 2014 via Android
    17
    骚年学学systemd吧
    maemual
    maemual
    Oct 29, 2014
    18
    居然还有这么多人不知道supervisor
    ericls
    ericls
    Oct 29, 2014 via Android
    19
    pip install supervisor
    frankzeng
    frankzeng
    Oct 29, 2014
    20
    @est 为什么要用while true,5分钟之类的跑一次不行么,要是代码逻辑有问题,瞬间就把机器弄死了。
    laputaprince
    laputaprince
    Oct 29, 2014
    21
    就我一个人用 upstart 么。。
    msg7086
    msg7086
    Oct 29, 2014 via iPhone
    22
    就我一个人用 god 么。。
    mulog
    mulog
    Oct 29, 2014
    23
    @laputaprince
    you are not alone :P
    clino
    clino
    Oct 29, 2014
    24
    supervisor +1
    hzqim
    hzqim
    Oct 29, 2014 via Android
    25
    @msg7086
    @laputaprince
    @bearice
    @ryd994
    谢谢您们的介绍!
    codeninja
    codeninja
    Oct 29, 2014 via Android
    26
    monit
    hq
    hq
    Oct 29, 2014
    27
    用supervisord也要注意server重启后supervisor自己会自动运行,不然负责监控的死了
    http://supervisord.org/running.html#running-supervisord-automatically-on-startup
    julyclyde
    julyclyde
    Oct 29, 2014
    28
    @maemual python-supervisor不能保证它自己不死啊
    jpuyy
    jpuyy
    Oct 30, 2014 via iPhone
    29
    直接用forever,还可以根据不同的日志输出到不同文件里方便排查问题
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1573 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 63ms · UTC 08:53 · PVG 16:53 · LAX 00:53 · JFK 03:53
    ♥ Do have faith in what you're doing.