首页 > 其他分享 >supervisor 安装和基本使用

supervisor 安装和基本使用

时间:2023-02-12 17:13:40浏览次数:38  
标签:基本 bin www supervisor supervisorctl usr 安装 user

安装

yum install supervisor
touch  /var/run/supervisor/supervisor.sock
chmod 777  /var/run/supervisor/supervisor.sock
supervisord
supervisorctl start all
supervisorctl status

配置目录:/etc/supervisor.d

基于swoft的配置

[program:user-center-gift]
process_name=%(program_name)s_%(process_num)02d
command=/usr/local/php/bin/php /home/www/userCenter/bin/swoft gift:write
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/home/www/supervisor_user-center-gift.log

[program:test]
# 设置命令在指定的目录内执行
directory=/www/go/src/gin-api
# 这里为您要管理的项目的启动命令
command=/www/go/src/gin-api/test
# 以哪个用户来运行该进程
user=root
# supervisor 启动时自动该应用
autostart=true
# 进程退出后自动重启进程
autorestart=true
# 进程持续运行多久才认为是启动成功
startsecs=1
# 重试次数
startretries=3
# stderr 日志输出位置
stderr_logfile=/www/go/src/gin-api/runtime/stderr.log
# stdout 日志输出位置
stdout_logfile=/www/go/src/gin-api/runtime/stdout.log

命令

#查看所有服务的状态
supervisorctl status
服务名 = user-center-gift:user-center-gift_00
#启动服务
supervisorctl start 服务名
#停止服务
supervisorctl stop 服务名
#重启服务
supervisorctl restart 服务名

常见报错

端口占用

Starting supervisor: Error: Another program is already listening on a port that one of our HTTP servers is configured to use.  Shut this program down first before starting supervisord.
For help, use /usr/bin/supervisord -h

显示的是有另一个进程占用了监听端口

查出来 kill掉
ps -ef | grep supervisord

提示setuptools版本问题

/usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:21: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please follow up at
https://bit.ly/setuptools-py2-warning.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
supervisor>

先看下版本

root@xxxxxx:~# which python
/usr/bin/python
root@xxxxxx:~# /usr/bin/python -V
Python 2.7.12

root@xxxxxx:~# which pip
/usr/bin/pip
root@xxxxxx:~# pip -V
pip 8.1.1 from /usr/lib/python2.7/dist-packages (python 2.7)

升级

pip2 install --upgrade --user pip

#使用pip 9.x或更高版本的Setuptools或固定setuptools<45在您的环境中
pip2 install --user "setuptools<45"

标签:基本,bin,www,supervisor,supervisorctl,usr,安装,user
From: https://www.cnblogs.com/HappyTeemo/p/17114132.html

相关文章

  • Gitbook的安装和部署
    安装npminstallgitbook-cli-ggitbook命令:gitbookinit//初始化目录文件gitbookhelp//列出gitbook所有的命令gitbook--help//输出gitbook-cli的帮助信息git......
  • Gogs安装
    Gogs环境要求我以rhel6.3为例,已经属于生命周期边缘了#安装gityuminstall-ygitgit--versiongitversion1.7.1#安装mysql-serveryuminstall-ymysql-server......
  • tomcat安装配置
    Tomcat下载 下载网址ApacheTomcat-ApacheTomcat®9软件下载 在左侧找到需要下载的版本,然后在右侧选择对应的环境 Tomcat环境配置在我的电脑中点击系统属性......
  • mac 安装 rbenv
    brewinstallrbenv#用来编译安装rubygitclonehttps://github.com/rbenv/ruby-build.git~/.rbenv/plugins/ruby-build#用来管理gemset,可选,因为有bundler......
  • 【前端工具】nodejs+npm+vue 安装(windows)
    预备先看看这几个是干嘛的,相互的关系是啥。nodejs是语言,类比到php。npm是个包管理,类比到composer。vue是个框架,类比到laravel。webpack是个打包工具。先下载nodejs......
  • ubuntu 安装 github desktop
    原文:https://gist.github.com/berkorbay/6feda478a00b0432d13f1fc0a50467f1sudowgethttps://github.com/shiftkey/desktop/releases/download/release-3.1.1-linux1/Gi......
  • docker的安装及常用命令
    安装docker(ubuntu16.0)1.首先更新源-apt-getupdate2.安装docker-aptinstalldocker常用命令1.查看本地镜像仓库-dockerimagesrepository-镜像名称TAG-镜像描述(l......
  • docker完整安装步骤
    docker脚本安装:curl-fsSLhttps://get.docker.com-oget-docker.shshget-docker.sh配置镜像加速器:sudomkdir-p/etc/dockersudotee/etc/docker/daemon.json<......
  • 传输层--可靠数据传输的基本原理
    可靠的数据传输:网络top10问题之一就是解决网络的可靠的数据传输。什么是可靠:即不丢,不错,不乱;rdt:reliabledatatransfer rdt1.0:......
  • 做基本的增删改查功能
    在控制类UserController中,要实现rest风格的增删改查功能,我们需要知道常用的四种请求类型:GET,POST,PUT,DELECT。对users进行操作,找的对应的url@RestController@RequestMa......