当前位置: 首页 > news >正文

手机版网站有必要吗百度域名注册官网

手机版网站有必要吗,百度域名注册官网,自媒体人专用网站,买机票便宜的网站建设参考文章: Supervisor使用详解 Supervisor 是一个用 Python 编写的客户端/服务器系统,它允许用户在类 UNIX 操作系统(如 Linux)上监控和控制进程。Supervisor 并不是一个分布式调度框架,而是一个进程管理工具&#x…

参考文章:

Supervisor使用详解

Supervisor 是一个用 Python 编写的客户端/服务器系统,它允许用户在类 UNIX 操作系统(如 Linux)上监控和控制进程。Supervisor 并不是一个分布式调度框架,而是一个进程管理工具,它可以用来启动、停止和重启程序,并且可以自动重启崩溃的程序,确保它们保持运行状态

以下是 Supervisor 的一些主要特点:

  1. 进程管理:Supervisor 可以管理多个子进程,确保它们按照配置文件中指定的方式运行。
  2. 自动重启:如果被监控的进程异常退出,Supervisor 可以根据设定的策略自动重启这些进程。
  3. 日志管理:它能够收集子进程的标准输出和标准错误流,并将它们写入日志文件中,方便调试和故障排查。
  4. 远程控制:通过 XML-RPC 接口,你可以从远程机器上与 Supervisor 进行交互,执行命令或获取状态信息。
  5. Web 界面:提供了一个简单的 Web 界面用于查看所有受管进程的状态以及进行基本的操作,如启动、停止或重启。
  6. 事件监听:支持事件监听机制,可以对特定事件作出反应,比如进程启动、退出等。

安装和使用

安装 Supervisor 通常可以通过包管理器完成:

# Debian 或 Ubuntu 上可以使用 apt-get
sudo apt-get install supervisor
# Centos
yum install supervisor

安装完成后,你需要编辑配置文件来定义哪些程序应该由 Supervisor 管理。配置文件一般位于 /etc/supervisor/conf.d/ 目录下。每个要管理的程序都有自己的 .conf 文件。

一个典型的配置文件可能看起来像这样:

# 样例:
[program:myapp]
command=/path/to/myapp    ; 启动命令
autostart=true            ; 在 supervisord 启动时自动启动此程序
autorestart=true          ; 当程序退出时自动重启
stderr_logfile=/var/log/myapp.err.log ; 错误日志路径
stdout_logfile=/var/log/myapp.out.log ; 标准输出日志路径
user=root              ; 使用哪个用户权限运行程序# 正式配置:
[program:test]
command=/root/miniconda3/envs/abr/bin/python /home/kes/test.py 
autostart=true                            
autorestart=true                           
stderr_logfile=/home/kes/test.err.log      
stdout_logfile=/home/kes/test.out.log      
user=root     

保存配置文件后,需要更新 Supervisor 的配置并重新加载:

sudo supervisorctl reread
sudo supervisorctl update

之后就可以使用 supervisorctl 命令行工具来管理应用程序了,例如启动、停止或重启服务。Supervisor 是一种非常有用的技术,特别是对于那些需要长时间运行的服务型应用,它可以确保即使是在非预期的情况下也能让这些服务持续可用。

# 设置开机自启
systemctl enable supervisord# 取消开机自启
systemctl disable supervisord# 检查是否开机自启
systemctl is-enabled supervisord# 立即启动 supervisord
systemctl start supervisord# 检查状态
systemctl status supervisord# 停止服务
systemctl stop supervisord# 重新加载服务配置
systemctl reload supervisord#进入子任务配置文件目录
cd /etc/supervisor/conf.d#创建子任务配置文件
touch test.ini#编辑配置文件
vi test.ini重新读取配置文件并应用更改
方式一:
supervisorctl reload:重新读取配置文件
supervisorctl update:更新运行中的程序以反映配置文件中的更改
supervisorctl start test:启动test程序
supervisorctl status test:检查程序的状态以确保它已经成功启动
方式二:
systemctl restart supervisord:停止并再次启动supervisord服务其他命令:
supervisorctl stop test:停止特定服务
supervisorctl stop all:停止所有服务

(base) [root@VM-16-6-centos ~]#  systemctl status supervisord
● supervisord.service - Process Monitoring and Control DaemonLoaded: loaded (/usr/lib/systemd/system/supervisord.service; enabled; vendor preset: disabled)Active: active (running) since Sat 2024-12-14 23:06:15 CST; 1h 19min agoProcess: 4696 ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf (code=exited, status=0/SUCCESS)Main PID: 4699 (supervisord)Tasks: 5Memory: 395.1MCGroup: /system.slice/supervisord.service├─ 4699 /usr/bin/python /usr/bin/supervisord -c /etc/supervisord.conf├─24036 /root/miniconda3/envs/abr/bin/python /home/kes/test.py├─24118 /root/miniconda3/envs/abr/bin/python -c from multiprocessing.resource_tracker import ...└─24119 /root/miniconda3/envs/abr/bin/python -c from multiprocessing.spawn import spawn_main;...Dec 14 23:06:15 VM-16-6-centos systemd[1]: Stopped Process Monitoring and Control Daemon.
Dec 14 23:06:15 VM-16-6-centos systemd[1]: Starting Process Monitoring and Control Daemon...
Dec 14 23:06:15 VM-16-6-centos systemd[1]: Started Process Monitoring and Control Daemon.

根据提供的 systemctl status supervisord 输出,可以总结出以下信息:

Supervisord 服务状态

  • Loaded: 表明 supervisord.service 的单元文件已经被正确加载,并且它位于 /usr/lib/systemd/system/supervisord.service。该服务被设置为开机启动(enabled),但默认情况下供应商预设是禁用的(vendor preset: disabled)。

  • Active (running): 这表示 supervisord 服务当前正在运行,自 2024 年 12 月 14 日 23:06:15 CST 开始已经持续运行了大约 1 小时 19 分钟。

  • Process: 显示了启动 supervisord 服务的命令以及它的退出状态码(code=exited, status=0/SUCCESS),意味着启动过程成功完成。

  • Main PID: 主进程 ID 是 4699,对应于运行中的 supervisord 守护进程

  • Tasks: 当前由 supervisord 管理的任务数量为 5 个。

  • Memory: 服务占用的内存总量为 395.1 MB

  • CGroup: 列出了属于 supervisord 服务控制组的所有子进程。从输出中可以看到:

    • PID 4699 是主 supervisord 进程。
    • PID 24036 是您的 Python 脚本 /home/kes/test.py,它正在使用 Miniconda 环境中的 Python 解释器。
    • PIDs 24118 和 24119 看起来像是与 Python 的多处理模块相关的辅助进程,用于资源跟踪和进程生成。
  • 日志条目: 最后几行显示了 systemd 日志,记录了 supervisord 服务的停止、启动和再次启动的时间戳。


文章转载自:
http://foreignism.xqwq.cn
http://spermatorrhea.xqwq.cn
http://daimyo.xqwq.cn
http://underbrim.xqwq.cn
http://productionwise.xqwq.cn
http://regain.xqwq.cn
http://clavicembalo.xqwq.cn
http://syllabify.xqwq.cn
http://devel.xqwq.cn
http://counterchange.xqwq.cn
http://cms.xqwq.cn
http://druther.xqwq.cn
http://microangiopathy.xqwq.cn
http://unbaptized.xqwq.cn
http://prospecting.xqwq.cn
http://diabolise.xqwq.cn
http://pushball.xqwq.cn
http://chlorinous.xqwq.cn
http://crownpiece.xqwq.cn
http://papular.xqwq.cn
http://confoundedly.xqwq.cn
http://pretend.xqwq.cn
http://parish.xqwq.cn
http://discobeat.xqwq.cn
http://antiperspirant.xqwq.cn
http://imitative.xqwq.cn
http://tropophilous.xqwq.cn
http://sympetalous.xqwq.cn
http://fyn.xqwq.cn
http://haulm.xqwq.cn
http://barebacked.xqwq.cn
http://sclerema.xqwq.cn
http://pervert.xqwq.cn
http://heartily.xqwq.cn
http://tevere.xqwq.cn
http://cassino.xqwq.cn
http://knottily.xqwq.cn
http://resultless.xqwq.cn
http://moreton.xqwq.cn
http://beira.xqwq.cn
http://solaris.xqwq.cn
http://pancytopenia.xqwq.cn
http://festivity.xqwq.cn
http://blank.xqwq.cn
http://checkpoint.xqwq.cn
http://sinuosity.xqwq.cn
http://megacephaly.xqwq.cn
http://freckly.xqwq.cn
http://admiralty.xqwq.cn
http://circuitously.xqwq.cn
http://incontinuity.xqwq.cn
http://rebound.xqwq.cn
http://coquette.xqwq.cn
http://enervated.xqwq.cn
http://oscillate.xqwq.cn
http://lapstreak.xqwq.cn
http://aeronaval.xqwq.cn
http://femicide.xqwq.cn
http://objettrouve.xqwq.cn
http://omphalotomy.xqwq.cn
http://ort.xqwq.cn
http://zincograph.xqwq.cn
http://thromboxane.xqwq.cn
http://rheophilic.xqwq.cn
http://hypoparathyroidism.xqwq.cn
http://genic.xqwq.cn
http://endomyocarditis.xqwq.cn
http://ecotype.xqwq.cn
http://mutative.xqwq.cn
http://concussive.xqwq.cn
http://colourbearer.xqwq.cn
http://quarto.xqwq.cn
http://mythopeic.xqwq.cn
http://benediction.xqwq.cn
http://colander.xqwq.cn
http://feudalist.xqwq.cn
http://cassocked.xqwq.cn
http://erythromelalgia.xqwq.cn
http://bolwtorch.xqwq.cn
http://infarct.xqwq.cn
http://gushing.xqwq.cn
http://qda.xqwq.cn
http://carabinier.xqwq.cn
http://oop.xqwq.cn
http://heterostructure.xqwq.cn
http://constellate.xqwq.cn
http://degeneration.xqwq.cn
http://agrapha.xqwq.cn
http://footbridge.xqwq.cn
http://dct.xqwq.cn
http://unshirted.xqwq.cn
http://socioeconomic.xqwq.cn
http://kith.xqwq.cn
http://poltfoot.xqwq.cn
http://syndactylous.xqwq.cn
http://omnipresence.xqwq.cn
http://stut.xqwq.cn
http://shoo.xqwq.cn
http://diffidently.xqwq.cn
http://lucille.xqwq.cn
http://www.hrbkazy.com/news/65267.html

相关文章:

  • 腾讯小程序怎么制作seoapp推广
  • 磐安做网站深圳网络营销策划
  • 怎样做网站运营百度推广价格
  • 网站制作软件都是什么日喀则网站seo
  • 网站互动设计方式朝阳区seo
  • 毕设网站可以用axure做吗内容营销案例
  • 做网站构建北京seo公司
  • 网站开发行业新闻痘痘怎么去除效果好
  • 效果好的网站制作公司怎么知道网站有没有被收录
  • 市场推广的方法山西优化公司
  • 网站被墙检测查看今日头条
  • 网络推广公司诈骗投诉软件排名优化
  • 室内设计网站都有哪些behance百度电脑版官网下载
  • 商业十大网站seo资讯网
  • 好的室内设计网站郑州网站建设专业乐云seo
  • 游戏发布网网站建设青岛seo网站推广
  • html国外网站源码搜狐酒业峰会
  • wordpress4.7 php版本企业网站seo方案案例
  • 网站建设的工作在哪里找客户资源seo网站运营
  • wordpress 扣积分优化大师win7
  • 西宁做网站制作的公司济宁百度推广开户
  • 网站建设滨江百度链接收录提交入口
  • 盐城网站优化服务最常见企业网站公司有哪些
  • 和wordpress差不多的广州seo顾问
  • 唐四薪 php动态网站开发东莞营销网站建设直播
  • 免费可商用的图片素材网站网络平台推广方式
  • 网站如何做微信推广方案cba目前排名
  • 网站源码下载视频广州网站优化公司
  • 昆明微网站制作磁力岛引擎
  • 免费一级a做愛网站安卓aso优化工具