V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
cevincheung
V2EX  ›  Linux

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

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

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

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