设为首页 加入收藏

TOP

配置supervisor管理beego应用(一)
2018-10-28 00:10:20 】 浏览:66
Tags:配置 supervisor 管理 beego 应用

一、golang、beego等环境安装与配置

二、supervisor安装

github项目地址:https://github.com/Supervisor/supervisor
克隆项目:git clone https://github.com/Supervisor/supervisor.git
进入项目:cd supervisor
安装执行:python setup.py install

三、supervisor配置文件

官方文档-配置部分
vi /etc/supervisord.conf

[supervisord]
http_port=/var/tmp/supervisor.sock ; (default is to run a UNIX domain socket server)
;http_port=127.0.0.1:9001  ; (alternately, ip_address:port specifies AF_INET)
;sockchmod=0700              ; AF_UNIX socketmode (AF_INET ignore, default 0700)
;sockchown=nobody.nogroup     ; AF_UNIX socket uid.gid owner (AF_INET ignores)
;umask=022                   ; (process file creation umask;default 022)
logfile=/var/log/supervisor/supervisord.log ; (supervisor输出日志,main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB       ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10          ; (num of main logfile rotation backups;default 10)
loglevel=info               ; (logging level;default info; others: debug,warn)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false              ; (start in foreground if true;default false)
minfds=1024                 ; (min. avail startup file descriptors;default 1024)
minprocs=200                ; (min. avail process descriptors;default 200)

;nocleanup=true              ; (don't clean up tempfiles at start;default false)
;http_username=user          ; (default is no username (open system))
;http_password=123           ; (default is no password (open system))
;childlogdir=/tmp            ; ('AUTO' child log dir, default $TEMP)
;user=chrism                 ; (default is current user, required if root)
;directory=/tmp              ; (default is not to cd during start)
;environment=KEY=value       ; (key value pairs to add to environment)

[supervisorctl]
serverurl=unix:///var/tmp/supervisor.sock ; use a unix:// URL  for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris              ; should be same as http_username if set
;password=123                ; should be same as http_password if set
;prompt=mysupervisor         ; cmd line prompt (default "supervisor")

[unix_http_server]
file=/var/tmp/supervisor.sock   ; (the path to the socket file)
;chmod=0777                 ; socket file mode (default 0700)
;chown=root:root       ; socket file uid:gid owner
;username=root              ; (default is no username (open server))
;password=root               ; (default is no password (open server))

[inet_http_server]
port = 127.0.0.1:9001

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:hello] ;可以在这边配置要管理的程序
directory=/home/www/php/ ;
command=/usr/bin/php test.php ;
process_name=%(program_name)s ;
numprocs=1 ;
autostart=true ;
startsecs=1 ;
autorestart=true ;
startretries=3 ;
user=root ;
redirect_stderr=true ;
stdout_logfile_maxbytes=20MB ;
stdout_logfile_backups=10 ;

[include] ;也可以通过include包含进来程序配置文件
files = ./supervisor/conf.d/*.ini ;

vi /etc/supervisor/conf.d/wx-prj.ini

[program:wx-prj]
;directory=/home/www/go/src/wx-prj ;go项目目录
;command=/home/www/go/src/wx-prj/wx-prj ;go项目编译好的可执行文件
directory=/home/www/go/bin ;
command=/home/www/go/bin/wx-prj ;
process_name=%(program_name)s ;
numprocs=1 ;
autostart=true ;
startsecs=1 ;
autorestart=true ;
startretries=3 ;
user=root ;
redirect_stderr=true ;
stdout_logfile=/home/www/go/wx-prj.stdout.log ;打印标准输出日志
stdout_logfile_maxbytes=20MB ;
stdout_logfi
编程开发网
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇go语言几个最快最好运用最广的web.. 下一篇Go基础系列:数据类型转换(strcon..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

array(4) { ["type"]=> int(8) ["message"]=> string(24) "Undefined variable: jobs" ["file"]=> string(32) "/mnt/wp/cppentry/do/bencandy.php" ["line"]=> int(214) }