python3安装supervisor – superit


本站和网页 https://www.msnao.com/2020/08/14/3945.html 的作者无关,不对其内容负责。快照谨为网络故障时之索引,不代表被搜索网站的即时页面。

python3安装supervisor – SuperIT
SuperIT
专业IT技术社区之后端大数据与Devops
首页
编程语言
架构
go
java
python
kafka
php
大数据
Manager
链接收集
学习项目
Java全栈知识
apache项目
开源项目
java项目
关于我们
联系我们
站点地图
登录
微信搜索superit|邀请体验:大数据, 数据管理、OLAP分析与可视化平台 | 赞助作者:赞助作者
python3安装supervisor
supervisor
aide_941
3年前 (2020-08-14)
8℃
 
yum install -y python3-pip python-pip
pip install supervisor=3.1.3
pip3 install supervisor
/bin/supervisord
supervisord -c /etc/supervisord.conf
mkdir -p /etc/supervisord.d/
/etc/supervisord.conf:
[unix_http_server]
file=/var/run/supervisor/supervisor.sock
; socket 路径
;chmod=0700
; socket 文件的权限
;chown=nobody:nogroup
; socket 所属用户及组
;username=user
; 用户名
;password=123
; 密码
;[inet_http_server]
; 是否启用服务,默认是关闭的(启用的话可以看到supervisor 管理的服务状态)
;port=127.0.0.1:9001
; 监听的IP及端口
[supervisord]
; supervisord 全局配置
logfile=/var/log/supervisor/supervisord.log
; supervisor 日志路径
logfile_maxbytes=50MB
; 单个日志文件最大数
logfile_backups=10
; 保留多少个日志文件(默认10个)
loglevel=info
; (log level;default info; others: debug,warn,trace)
pidfile=/var/run/supervisord.pid ; pid 文件路径
nodaemon=false
; 启动是否丢到前台,设置为false ,表示以daemon 的方式启动
minfds=1024
; 最小文件打开数,对应系统limit.conf 中的nofile ,默认最小为1024,最大为4096
minprocs=200
; 最小的进程打开数,对应系统的limit.conf 中的nproc,默认为200
;umask=022
; (process file creation umask;default 022)
;user=chrism
; 启动supervisord 服务的用户,默认为root
;identifier=supervisor
; (supervisord identifier, default is 'supervisor')
;directory=/tmp
; 这里的目录指的是服务的工作目录
;nocleanup=true
; (don't clean up tempfiles at start;default false)
;childlogdir=/tmp
; ('AUTO' child log dir, default $TEMP)
;environment=KEY=value
; (key value pairs to add to environment)
;strip_ansi=false
; (strip ansi escape codes in logs; def. false)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor/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
; should be same as http_password if set
;prompt=mysupervisor
; cmd line prompt (default "supervisor")
;history_file=~/.sc_history
; use readline history if available
; The below sample program section shows all possible program subsection values,
; create one or more 'real' program: sections to be able to control them under
; supervisor.
;[program:theprogramname]
; 定义一个守护进程 ,比如下面的elasticsearch
;command=/bin/cat
; 启动程序使用的命令,可以是绝对路径或者相对路径
;process_name=%(program_name)s ; 一个python字符串表达式,用来表示supervisor进程启动的这个的名称,默认值是%(program_name)s
;numprocs=1
; Supervisor启动这个程序的多个实例,如果numprocs>1,则process_name的表达式必须包含%(process_num)s,默认是1
; supervisord在生成子进程的时候会切换到该目录
; umask for process (default None)
;priority=999
; 权重,可以控制程序启动和关闭时的顺序,权重越低:越早启动,越晚关闭。默认值是999
;autostart=true
; 如果设置为true,当supervisord启动的时候,进程会自动启动
;autorestart=true
; 设置为随 supervisord 重启而重启,值可以是false、true、unexpected。false:进程不会自动重启
;startsecs=10
; 程序启动后等待多长时间后才认为程序启动成功,默认是10秒
;startretries=3
; supervisord尝试启动一个程序时尝试的次数。默认是3
;exitcodes=0,2
; 一个预期的退出返回码,默认是0,2。
;stopsignal=QUIT
; 当收到stop请求的时候,发送信号给程序,默认是TERM信号,也可以是 HUP, INT, QUIT, KILL, USR1, or USR2
;stopwaitsecs=10
; 在操作系统给supervisord发送SIGCHILD信号时等待的时间
; 如果supervisord以root运行,则会使用这个设置用户启动子程序
;redirect_stderr=true
; 如果设置为true,进程则会把标准错误输出到supervisord后台的标准输出文件描述符
;stdout_logfile=/a/path
; 把进程的标准输出写入文件中,如果stdout_logfile没有设置或者设置为AUTO,则supervisor会自动选择一个文件位置
;stdout_logfile_maxbytes=1MB
; 标准输出log文件达到多少后自动进行轮转,单位是KB、MB、GB。如果设置为0则表示不限制日志文件大小
;stdout_logfile_backups=10
; 标准输出日志轮转备份的数量,默认是10,如果设置为0,则不备份
;stdout_capture_maxbytes=1MB
; 当进程处于stderr capture mode模式的时候,写入FIFO队列的最大bytes值,单位可以是KB、MB、GB
;stdout_events_enabled=false
; 如果设置为true,当进程在写它的stderr
;stderr_logfile=/a/path
; 把进程的错误日志输出一个文件中,除非redirect_stderr参数被设置为true
;stderr_logfile_maxbytes=1MB
; 错误log文件达到多少后自动进行轮转,单位是KB、MB、GB。如果设置为0则表示不限制日志文件大小
;stderr_logfile_backups=10
; 错误日志轮转备份的数量,默认是10,如果设置为0,则不备份
;stderr_capture_maxbytes=1MB
;stderr_events_enabled=false
; 如果设置为true,当进程在写它的stderr到文件描述符的时候,PROCESS_LOG_STDERR事件会被触发
;environment=A=1,B=2
; 一个k/v对的list列表
;serverurl=AUTO
; 是否允许子进程和内部的HTTP服务通讯,如果设置为AUTO,supervisor会自动的构造一个url
; The below sample eventlistener section shows all possible
; eventlistener subsection values, create one or more 'real'
; eventlistener: sections to be able to handle event notifications
; sent by supervisor.
; #这个地方是自定义一个守护进程
[program:elasticsearch]
; 定义一个守护进程 elasticsearch
environment=ES_HOME=/usr/local/elasticsearch
; 设置ES_HOME 环境变量
user=elk
; 启动elasticsearch 的用户
directory=/usr/local/elasticsearch
; 进入到这个目录中
command=/usr/local/elasticsearch/bin/elasticsearch ; 执行启动命令
numprocs=1
autostart=true
; 设置为随 supervisord 启动而启动
autorestart=true
; 设置为随 supervisord 重启而重启
startretries=3
; 设置elasticsearch 重启的重试次数
priority=1
;[eventlistener:theeventlistenername]
;command=/bin/eventlistener
; the program (relative uses PATH, can take args)
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
; number of processes copies to start (def 1)
;events=EVENT
; event notif. types to subscribe to (req'd)
;buffer_size=10
; event buffer queue size (default 10)
; directory to cwd to before exec (def no cwd)
;priority=-1
; the relative start priority (default -1)
; start at supervisord start (default: true)
;autorestart=unexpected
; restart at unexpected quit (default: unexpected)
; number of secs prog must stay running (def. 1)
; max # of serial start failures (default 3)
; 'expected' exit codes for process (default 0,2)
; signal used to kill process (default TERM)
; max num secs to wait b4 SIGKILL (default 10)
; setuid to this UNIX account to run the program
; redirect proc stderr to stdout (default false)
; stdout log path, NONE for none; default AUTO
; max # logfile bytes b4 rotation (default 50MB)
; # of stdout logfile backups (default 10)
; emit events on stdout writes (default false)
; stderr log path, NONE for none; default AUTO
;stderr_logfile_backups
; # of stderr logfile backups (default 10)
; emit events on stderr writes (default false)
; process environment additions
; override serverurl computation (childutils)
; The below sample group section shows all possible group values,
; create one or more 'real' group: sections to create "heterogeneous"
; process groups.
;[group:thegroupname]
; 服务组管理,可以将多个服务名写到这里管理(组名自定义)
;programs=progname1,progname2
; 上面配置好的服务名,比如elasticsearch,kibana,logstash
; the relative start priority (default 999)
; The [include] section can just contain the "files" setting.
This
; setting can list multiple files (separated by whitespace or
; newlines).
It can also contain wildcards.
The filenames are
; interpreted as relative to this file.
Included files *cannot*
; include files themselves.
[include]
files = supervisord.d/*.ini
我要做一个基于alpine镜像build一个python3的Docker镜像,需要安装supervisor,但是supervisor默认是只支持python2.4以上版本但是不包括python3以上版本的,此文档是介绍python3安装supervisor
报错内容
如果直接用pip3安装supervisor会提示:Supervisor requires Python 2.4 or later but does not work on any version of Python 3. You are using version 3.6.6 (default, Aug 24 2018, 05:04:18)
10
Collecting supervisor
Downloading https://files.pythonhosted.org/packages/ba/65/92575a8757ed576beaee59251f64a3287bde82bdc03964b89df9e1d29e1b/supervisor-3.3.5.tar.gz (421kB)
100% |████████████████████████████████| 430kB 230kB/s
Complete output from command python setup.py egg_info:
Supervisor requires Python 2.4 or later but does not work on any version of Python 3.
You are using version 3.6.6 (default, Aug 24 2018, 05:04:18)
[GCC 6.4.0].
Please install using a supported version.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-efd06mz0/supervisor/
解决方法
需要安装git
11
pip3 install git+https://github.com/Supervisor/supervisor#egg=supervisor
Collecting supervisor from git+https://github.com/Supervisor/supervisor#egg=supervisor
Cloning https://github.com/Supervisor/supervisor to /tmp/pip-install-dqs3jvuu/supervisor
Collecting meld3>=1.0.0 (from supervisor)
Downloading https://files.pythonhosted.org/packages/b6/ae/e6d731e4b9661642c1b20591d8054855bb5b8281cbfa18f561c2edd783f7/meld3-1.0.2-py2.py3-none-any.whl
Installing collected packages: meld3, supervisor
Running setup.py install for supervisor ... done
Successfully installed meld3-1.0.2 supervisor-4.0.0.dev0
which supervisorctl
/usr/bin/supervisorctl
参考文档
关于python3.x上supervisor安装问题?
转载请注明:
»
喜欢 (
or
分享 (
安装
Supervisor安装与配置教程
Linux脚本基础之if [-d -e -f]等参数
同时安装docker-desktop,rancher-desktop设置上下文context
微信小程序直播安装和开发指南
Etcd3常用操作-python版本
Python—在Django中使用Celery
用Python操作HBase之HBase-Thrift
详解Supervisor进程守护监控
Ansible详解(一)基础安装和配置
ansible简介 及 CentOS7 安装ansible (rpm)及 安装ansible插件ansible-cmdb 实现cmdb功能
订阅号“superit.tech”
近期文章
硬件开发工具
基于阿里云ECS服务器的k8s集群环境搭建
kubernetes 部署 Ingress-nginx controller-v1.8.0
参考
k8s部署ingress-nginx的方法步骤
使用idea打包war包
资源缓存未生效
进程、线程、协程的概念
docker Gitlab 重置账号以及密码
分类目录
选择分类目录
dev  (51)
   php  (27)
   高并发  (24)
devops  (229)
   aliyun  (3)
   ansible  (6)
   cdn  (2)
   docker  (34)
   ffmpeg  (4)
   git  (5)
   gitlab  (3)
   jenkins  (8)
   linux  (39)
   lua  (1)
   mac  (2)
   maven  (3)
   monitor  (3)
   mysql  (9)
   nginx  (22)
   rabbitmq  (1)
   redis  (5)
   shell  (15)
   slb  (41)
   supervisor  (7)
   zabbix  (2)
   持续集成  (8)
   漏洞修复  (6)
   激活码(注册码)  (1)
go  (27)
IOS  (11)
   ui  (4)
java  (95)
   aop  (1)
   config  (3)
   dubbo  (7)
   jdbc  (2)
   jmeter  (1)
   jpa  (1)
   mybatis  (7)
   spring  (16)
   springboot  (7)
   springcloud  (2)
   springmvc  (1)
   tomcat  (2)
manager  (1)
python  (25)
SEO  (1)
tensorflow  (2)
video  (2)
个人操作  (2)
前端  (6)
原创  (5)
填坑记  (1)
大数据  (239)
   clickhouse  (7)
   elasticsearch  (40)
   flink  (4)
   Flume  (19)
   hadoop  (16)
   hbase  (5)
   hive  (9)
   kafka  (67)
   kibana  (7)
   Logstash  (3)
   spark  (12)
   sphinx  (3)
   sqoop  (6)
   storm  (10)
   zookeeper  (11)
   日志采集  (29)
   职位要求  (3)
我的操作  (2)
未分类  (34)
架构  (60)
测试  (2)
链接  (10)
随记  (7)
标签
安装 (7)
gitlab (6)
php (6)
操作 (6)
python (6)
使用 (6)
jvm (5)
并发 (5)
git (5)
spring (5)
一步步教你nginx+lvs之教程 (5)
参数 (4)
优化 (4)
compose (4)
调优 (4)
性能 (4)
maven (4)
centos (4)
解决方案 (4)
数据 (4)
部署 (4)
负载 (4)
Spark (4)
分享 (4)
服务 (4)
新手 (4)
分布式 (4)
管理工具 (4)
日志 (4)
jar (4)
启动 (3)
raft (3)
选举 (3)
搭建 (3)
利用 (3)
进程 (3)
swarm (3)
topic (3)
总结 (3)
内核 (3)
QQ:1219204@qq.com   京ICP备20002829号-1  
版权声明