帮酷LOGO

Process managerment writtern by golang, inspired by python-supervisor

由 python 主管激发的golang进程 managerment writtern

将光标移到/点击文章中的句子上,可以查看译文。 显示原文      显示译文      双语对照

  • 显示内容
文章标签:监督者  Super  PROC  MAN  golang  SUP  
golang port of python-supervisor



  • Source Code:gosuv
  • WebSite:http://www.github.com/codeskyblue/gosuv
  • gosuv Documents
  • gosuv Download
  • gosuv

    Build Status

    current is in beta

    Process management writtern by golang, inspired by python-supervisor

    so why write another supervisor?

    I have been using python-supervisor for many years and there are something uncomfortable feelings.

    • Log can't contains ANSI color chars
    • The configuration file can add on the web, often forgot some settings.
    • supervisorctl reload will cause supervisord restarted
    • Hard to set status change to fatal notifications.
    • No process performance monitor page.
    • Program starts with no common environ, eg, missing HOME and USER variable
    • Kill process default is not group kill which make sub process still running.
    • More... will added when i think of it.

    Features

    • Web control page

    • HTTP Basic auth

    • Github webhook

    • Single log page, include search support

    Requirements

    Go version at least 1.6+

    Installation

    Binaries

    The fastest way is run with.Default install location is /usr/local/bin, change env-var BINDIR will also change install location.

    curl https://raw.githubusercontent.com/codeskyblue/gosuv/master/get.sh | bash

    Or just download binaries

    https://github.com/codeskyblue/gosuv/releases

    Thanks to goreleaser which makes publish binaries automaticly.

    Build from source

    go get -d github.com/codeskyblue/gosuvcd$GOPATH/src/github.com/codeskyblue/gosuv
    go generate # package html resources into gogo build -tags vfs

    Quick start

    After you installed gosuv, the first thing is to start server.

    gosuv start-server

    Basic operations

    $ gosuv status
    PROGRAM NAME STATUStest running
    test_again stopped
    $ gosuv stop test$ gosuv start test

    Open web http://localhost:11313 to see the manager page.and follow the gif to add a program to gosuv.

    gosuv web

    Configuration

    Default config file stored in directory $HOME/.gosuv/, Set env-var GOSUV_HOME_DIR can change config file store directory.

    • file programs.yml contains all program settings.
    • file config.yml contains server config

    File config.yml can be generated by gosuv conftest

    Example config.yaml

    server:
     httpauth:
     enabled: true
     username: admin
     password: admin
     addr: :8083
     name: 10.10.99.177
     master:""
    notifications:
     dingtalk:
     groups:
     - secret: c1b8032******************aa736a
     mobile:
     -"153********"
    client:
     server_url: http://admin:admin@localhost:8083

    master 的支持来自 https://github.com/ihaiker/distributed-gosuv Logs can be found in $HOME/.gosuv/log/

    Edit config file(default located in $HOME/.gosuv/programs.yml ) and run gosuv reload will take effect immediately.

    Design

    HTTP is follow the RESTFul guide.

    Get or Update program

    <GET|PUT>/api/programs/:name

    Add new program

    POST/api/programs

    Del program

    DELETE/api/programs/:name

    State

    Only 4 states. ref

    states

    Notification

    Configuration example

    - demo-program:
     command: ...notifications:
     pushover:
     api_key: [token]users:
     - [user1] - [user2]

    Now only support pushover, and only status change to fatal will get notified.

    Integrate with github (todo )

    This is feature that will helps update your deployment environment once your updated in the github.

    This part is set in the programs.yml, take look the example

    - demo-program:
     command: python app.pydirectory: /opt/demowebhook:
     github:
     secret: 123456command: git pull origin master

    LICENSE

    MIT



    文章标签:MAN  SUP  PROC  golang  Super  监督者  

    Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备05059198号-3  |  如果智培  |  酷兔英语