1. 我们使用brew管理,先搜索一下确认是否有我们需要的软件包

# davis @ XiaoWeis-MacBook-Pro in ~ [16:48:42]
$ brew search supervisor
==> Formulae
supervisor ✔ homebrew/linuxbrew-core/supervisor

  

2. 执行安装

brew install supervisor

  

3. 启动程序

brew services start supervisor

  

4. ps 查看进程是否启动成功

# davis @ XiaoWeis-MacBook-Pro in ~ [16:56:33]
$ ps aux|grep supervisor
davis 12015 0.0 0.1 4309560 7560 ?? S 3:19PM 0:02.06 /usr/local/Cellar/supervisor/3.3.4/libexec/bin/python2.7 /usr/local/opt/supervisor/bin/supervisord -c /usr/local/etc/supervisord.ini --nodaemon
davis 16638 0.0 0.0 4268020 780 s000 S+ 4:57PM 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn supervisor

  

5. supervisord.ini 配置

/usr/local/etc/supervisord.ini

  配置文件末尾有一个载入配置的路径

[include]
files = /usr/local/etc/supervisor.d/*.ini

  然后我们新建一个supervisor.d目录

mkdir supervisor.d

  然后我们进入到这个目录中,新建一个xxx.ini文件,就可以写我们自己的配置了,就像nginx server目录下一样的道理

6.配置项,参数详情:https://blog.51cto.com/lixcto/1539136

[program:weatherApi]
directory = /Users/davis/python_prduction/weather
command = /usr/local/bin/python3.7 /Users/davis/python_prduction/weather/index.py
autostart = true
startsecs = 3
autorestart = true
startretries = 3
user = davis
redirect_stderr = true
stdout_logfile_backups = 20
stdout_logfile=/Users/davis/logs/weather_api_success.log
stdout_logfile_maxbytes=10MB

  然后保存退出,/usr/local/etc,退到这个路径

# davis @ XiaoWeis-MacBook-Pro in /usr/local/etc [17:22:45]
$ supervisorctl -c supervisord.ini
autoUpdataWeatherData STOPPED May 15 05:06 PM
weatherApi STOPPED May 15 05:06 PM
supervisor> reload
Really restart the remote supervisord process y/N? y
Restarted supervisord
supervisor>

  reload 重启

  start weatherApi 启动

  stop weatherApi 停止

  

supervisor 管理进程 基本用法的更多相关文章

  1. Linux服务:使用Supervisor管理进程

    一.简介 由于基本每个公司都会用到supervisor这个进程管理工具,这里简单阐述一下. Supervisor (http://supervisord.org) 是一个用Python写Linux下的 ...

  2. Supervisor管理进程

    Supervisor管理进程 转载 2016年04月14日 18:26:45 标签: supervisord 28344 Supervisor重新加载配置启动新的进程 liaojie 发布于 1年前, ...

  3. Supervisor 管理进程,Cloud Insight 监控进程,完美!

    Supervisor 是由 Python 语言编写.基于 linux 操作系统的一款服务器管理工具,用于监控服务器的运行,发现问题能立即自动预警及自动重启等. Cloud Insight 是一款次世代 ...

  4. supervisor管理进程 superlance对进程状态报警

    supervisor介绍 首先,介绍一下supervisor.Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linu ...

  5. supervisor管理进程工具配置

    Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统 ...

  6. 在Docker里使用(支持镜像继承的)supervisor管理进程(转)

    这篇文章是受 dockboard 之托帮忙翻译的与 docker 有关的技术文章.译自 Using Supervisor with Docker to manage processes (suppor ...

  7. Django与supervisor 管理进程

    1.前言 在Django项目中,我们需要用到一些独立于Django框架外的脚本.这样一些脚本可能需要独立的持续运行,且具有很强的可维护性,这个时候supervisor就可以排上用场了. 基于pytho ...

  8. php使用supervisor管理进程脚本

    supervisor是用python开发的一个在linux系统下的进程管理工具,可以方便的监听,启动,停止一个或多个进程.当一个进程被意外杀死后,supervisor监听到后,会自动重新拉起进程. 一 ...

  9. pm2 代替 Supervisor 管理进程

    前提 我们在使用 Laravel 的时候不免用到列队来处理任务,而 Laravel 官方文档给出的是 Supervisor 来管理进程和监控.但是我们在使用中有下面几个缺点: Supervisor 单 ...

随机推荐

  1. mongoose 警告信息 { useNewUrlParser: true } { useUnifiedTopology: true }

    问题: 解决:

  2. Qt Table Widget常用操作

    一.鼠标悬浮在item上 显示提示信息 1.在构造函数开启table Widget控件的鼠标捕获功能 // 开启鼠标捕获功能(实现table widget的悬浮功能) ui.tableWidget-& ...

  3. Appscan漏洞之跨站点请求伪造(CSRF)

    公司前段时间使用了Fortify扫描项目代码,在修复完这些Fortify漏洞后,最近又启用了Appscan对项目代码进行漏洞扫描,同样也是安排了本人对这些漏洞进行修复.现在,针对修复过的Appscan ...

  4. centos没有service命令的恢复方法(-bash: service: command not found)

    转载自:https://blog.csdn.net/u014175572/article/details/53375049?utm_source=itdadao&utm_medium=refe ...

  5. iOS 静态、全局变量、常量

    关键字static 两个概念:生命周期.作用域生命周期:这个变量能存活多久,它所占用的内存什么时候分配,什么时候收回.作用域:这个变量在什么区域是可见的,可以拿来用的. static分两种情况:修饰局 ...

  6. hybris commerce storefront的产品搜索功能

    在Hybris Commerce Cloud的storefront的搜索栏键入一些字母,每次键入,会触发一个发送到后台的http请求实现live search的功能: http url如下:https ...

  7. LeetCode算法01 Valid Parentheses

    Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the inpu ...

  8. Jenkins 邮件配置 || Jenkins 发送邮件失败,提示:Error sending to the following VALID addresses

    jenkins---系统管理---系统设置 在Jenkins URL下填写URL链接 在系统管理员邮件地址下填写发件邮箱,这将是以后发送邮件通知的发件人 如果下载了外部邮件通知 配置一下SMTP se ...

  9. 《BUG创造队》作业8:软件测试与Alpha冲刺(第三天)

    项目 内容 这个作业属于哪个课程 2016级软件工程 这个作业的要求在哪里 实验十二 团队作业8:软件测试与ALPHA冲刺 团队名称 BUG创造队 作业学习目标 (1)掌握软件测试基础技术.(2)学习 ...

  10. Bias vs. Variance(4)---根据是high bias还是high variance问题来判断接下来做些什么

    怎么区分哪些措施对我们有用呢?----首先根据learning curve来判断你的问题是high bias or variance 当你的算法是high bias问题时,如果你get more tr ...