首页 > 系统相关 >Centos 7 pip3安装 supervisor

Centos 7 pip3安装 supervisor

时间:2023-04-09 19:01:08浏览次数:40  
标签:supervisor pip3 Centos etc supervisorctl nginx conf supervisord

1、安装supervisor

pip3installsupervisor

2、新建文件夹

mkdir/etc/supervisord.d

3、生成supervisor.conf配置

echo_supervisord_conf>/etc/supervisord.conf

4、启动supervisor

/usr/local/python3/bin/supervisord-c/etc/supervisord.conf

5、例子:配置supervisor管理nginx进程

vim/etc/supervisord.conf

去掉注释

[include]files=/etc/supervisord.d/*.conf

配置supervisor管理nginx的配置文件

vim/etc/supervisord.d/nginx_test.conf[program:nginx]command=/usr/sbin/nginxstdout_logfile=/tmp/nginx.logstderr_logfile=/tmp/nginx_err.logautostart=trueautorestart=truestartsecs=10stopwaitsecs=50     #这里最好配置 
priority=1 

6、supervisor不能管理daemon进程,nginx 是daemon进程,如果要管理,需要在nginx.conf配置文件的http标签外增加 daemon off; 此处只是测试适用

# 修改nginx配置
[root@auto super]# vim /etc/nginx/nginx.confusernginx;worker_processes1;daemonoff;events{worker_connections1024;}http{.......

7、重启nginx,supervisor

supervisorctlreload

其他命令

supervisorctl #查看所有子进程的状态
supervisorctl reload #重启  修改了supervisord.conf ,需要执行来重新加载配置文件
supervisorctl status #查看所有进程的状态
supervisorctl stop demo #停止
supervisorctl start demo #启动
supervisorctl restart demo #重启
supervisorctl update #配置文件修改或新增后可以使用该命令加载新的进程

8、web界面管理supervisor进程

修改配置文件,然后重启

vim/etc/supervisor.conf
#去掉注释,下面是修改部分

[inet_http_server] ; inet (TCP) server disabled by default
port=192.168.10.66:9001;ip_address:portspecifier,*:portfor all iface
username=user;default isnousername(openserver)password=123;default isnopassword(openserver)

 

 

 

 

 

  mkdir/etc/主管

标签:supervisor,pip3,Centos,etc,supervisorctl,nginx,conf,supervisord
From: https://www.cnblogs.com/lfxx/p/17300808.html

相关文章

  • Centos 7 安装 Python3.9.16
    1、下载Python官网(https://www.python.org/downloads/)对应的安装包,选择3.9.16的linux版本wgethttps://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz2、解压tgz包tarzxvfPython-3.9.16.tgz-C/opt3、创建Python-3.6.5安装目录mkdir/usr/local/python34、安装依......
  • CentOS7/RHEL7 pacemaker+corosync高可用集群搭建
    CentOS7/RHEL7pacemaker+corosync高可用集群搭建一、集群信息二、集群搭建1、制作软件源2、主机基础配置3、集群基础环境准备4、集群资源准备5、资源配置6、constraint配置7、stonith配置8、集群功能验证三、集群常用命令及作用1、验证群集安装2、查看群集资源3、使......
  • centos6.5安装流量监控工具iftop【杭州多测师】【杭州多测师_王sir】
    一、概述iftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等,详细的将会在后面的使用参数中说明。官方网站:http://www.ex-parrot.com/~pdw/iftop/二、依赖包安装yum install -y gcc flex byacc libpcap ncurses ncurses-devel libpcap-devel tcpdu......
  • CentOS7防火墙操作
    查看防火墙状态systemctlstatusfirewalld开启防火墙systemctlstartfirewalld关闭防火墙systemctlstopfirewalld查看防火墙是否开机自启systemctlis-enabledfirewalld开启开机自启systemctlenablefirewalld关闭开机自启systemctldisablefirewalld开......
  • CentOS7静态IP配置
    1编辑网卡配置文件vim/etc/sysconfig/network-scripts/ifcfg-ens33修改/添加如下选项,根据自己的情况BOOTPROTO=static #修改ip为静态,这是已有的配置,修改就好IPADDR=你想设置的ip #静态ip地址NETMASK=你的子网掩码 #子网掩码GATEWAY=你的网关 #网关地址DNS1=你的网关 ......
  • CentOS7-实现全网备份脚本
    一、应用场景备份公司的重要的文件或者日志文件,系统配置文件等二、脚本思路1、本地打包备份2、同步服务推送至备份服务器3、同步成功发送邮件提醒管理员4、编写计划任务5、本地备份文件保留时间,服务器备份文件保留时间三、项目实施1、服端配置rsync服务步骤一:安装rsync......
  • Centos 7 yum源安装nginx
    1.设置nginx仓库vim/etc/yum.repos.d/nginx.repo[nginx-stable]name=nginxstablerepobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.keymodule_hotfixes=true[nginx-mainline]na......
  • CentOS 7 关闭IPv6
    一、编辑/etc/default/grub编辑/etc/default/grub,在GRUB_CMDLINE_LINUX加上的后面句首加上ipv6.disable=1。修改之前:[root@localhost~]#cat/etc/default/grubGRUB_TIMEOUT=5GRUB_DISTRIBUTOR="$(sed's,release.*$,,g'/etc/system-release)"GRUB_DEFAULT=saved......
  • ES搜索框架--ES部署到Centos8服务器
    参考:https://blog.csdn.net/Me_xuan/article/details/114608076https://www.cnblogs.com/chenxitag/p/12320868.html一、下载安装1.下载ES使用elasticsearch7.10.2,到官网下载对应的linux包,然后上传到服务器文件夹下,cd到文件夹后使用tar命令解压tar-xvfelasticsearch-7.10.2-linu......
  • Centos7 时间显示不对
    修改系统时区timedatectlset-timezoneAsia/Shanghai安装NTPyum-yinstallntp使用ntpdate更新系统时间ntpdatepool.ntp.org使用date查看时区是否正确date启动ntpddaemon,持续校准时间 systemctlstartntpd ......