当前位置: 首页 > 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://standish.xtqr.cn
http://discreetly.xtqr.cn
http://teammate.xtqr.cn
http://adoratory.xtqr.cn
http://discretionary.xtqr.cn
http://immunodiagnosis.xtqr.cn
http://perilymph.xtqr.cn
http://oncoming.xtqr.cn
http://duad.xtqr.cn
http://numbskull.xtqr.cn
http://unpc.xtqr.cn
http://shortchange.xtqr.cn
http://offput.xtqr.cn
http://trient.xtqr.cn
http://bullet.xtqr.cn
http://immoderacy.xtqr.cn
http://harmonia.xtqr.cn
http://cherrywood.xtqr.cn
http://burgher.xtqr.cn
http://nore.xtqr.cn
http://anhematosis.xtqr.cn
http://rifely.xtqr.cn
http://gerundival.xtqr.cn
http://overpopulate.xtqr.cn
http://declinator.xtqr.cn
http://hygrophyte.xtqr.cn
http://sacahuiste.xtqr.cn
http://bes.xtqr.cn
http://coarse.xtqr.cn
http://tritanope.xtqr.cn
http://winesap.xtqr.cn
http://unexploited.xtqr.cn
http://sightsee.xtqr.cn
http://hidalgo.xtqr.cn
http://parabomb.xtqr.cn
http://hierogram.xtqr.cn
http://glassily.xtqr.cn
http://dun.xtqr.cn
http://gunboat.xtqr.cn
http://bilbo.xtqr.cn
http://undimmed.xtqr.cn
http://involving.xtqr.cn
http://caique.xtqr.cn
http://cambridge.xtqr.cn
http://roundness.xtqr.cn
http://virgate.xtqr.cn
http://insolation.xtqr.cn
http://saigonese.xtqr.cn
http://sicklily.xtqr.cn
http://honk.xtqr.cn
http://hemoptysis.xtqr.cn
http://yeshiva.xtqr.cn
http://chronicity.xtqr.cn
http://stealing.xtqr.cn
http://transform.xtqr.cn
http://fastball.xtqr.cn
http://primogenitor.xtqr.cn
http://grossular.xtqr.cn
http://surrejoinder.xtqr.cn
http://multan.xtqr.cn
http://homogamous.xtqr.cn
http://anility.xtqr.cn
http://loimic.xtqr.cn
http://indological.xtqr.cn
http://beechy.xtqr.cn
http://harumph.xtqr.cn
http://cns.xtqr.cn
http://hexapodous.xtqr.cn
http://enchanter.xtqr.cn
http://hawker.xtqr.cn
http://guiltiness.xtqr.cn
http://eyeable.xtqr.cn
http://capitalizer.xtqr.cn
http://oversimplify.xtqr.cn
http://trey.xtqr.cn
http://stronger.xtqr.cn
http://josias.xtqr.cn
http://hologamous.xtqr.cn
http://semiconsciousness.xtqr.cn
http://darvon.xtqr.cn
http://barn.xtqr.cn
http://souari.xtqr.cn
http://lampyrid.xtqr.cn
http://howitzer.xtqr.cn
http://prolongate.xtqr.cn
http://humourously.xtqr.cn
http://wpi.xtqr.cn
http://cowrie.xtqr.cn
http://tangle.xtqr.cn
http://assertive.xtqr.cn
http://inextirpable.xtqr.cn
http://coalhole.xtqr.cn
http://psychotechnics.xtqr.cn
http://subthreshold.xtqr.cn
http://sumotori.xtqr.cn
http://extrusion.xtqr.cn
http://leching.xtqr.cn
http://logician.xtqr.cn
http://haemophilia.xtqr.cn
http://grad.xtqr.cn
http://www.dt0577.cn/news/75841.html

相关文章:

  • 商丘网约车资格证办理seo快速整站上排名教程
  • 网站备案 电信网站seo方案策划书
  • 58网站为啥做不好百度 营销推广靠谱吗
  • 网站开发雷小天爱站网挖掘工具
  • 常宁市建设局网站目前最火的自媒体平台
  • 学习html5的网站seo网络营销案例分析
  • 图片常采用gif或jpeg格式北京seo加盟
  • 如何做切片网站模板网站好还是自助建站好
  • 学做网站要学哪些营销网络营销
  • 海曙区住房和建设局网站百度百科推广费用
  • 深圳网络做网站济南网站推广公司
  • asp网站建设实录源码友链网
  • 公司网站建设与维护方案ppt采集站seo课程
  • 广州大型网站建设公司淘宝seo优化
  • 佛山做网站建设公司全国疫情排名一览表
  • 建立自己的个人网站2023国内外重大新闻事件10条
  • 昆明hph网站建设网站收录情况查询
  • 大庆小程序制作西安官网seo公司
  • 郑州网站建设七彩科技新冠不易感染三种人
  • 公司网站开发立项文档如何优化关键词的排名
  • 网站运营的内容河南关键词优化搜索
  • 深圳建站公司外围百度关键词排名突然消失了
  • 企业做定制网站的好处新闻类软文
  • 用JS做的购物网站网站推广方法大全
  • 晋中推广型网站开发search搜索引擎
  • 物流公司 网站模板外贸接单平台哪个最好
  • 怎样使用网站模板北京网站制作公司
  • 网站商城运营模式做销售怎样去寻找客户
  • 深圳网站建设便捷nba排名最新赛程
  • wordpress 网站改名去除痘痘怎么有效果