Centos Linux Supervisor安装与配置(linux/unix进程管理工具)

前言

由于在项目中,需要使用到Supervisor这个进程管理工具,所以通过实践的方式,逐步的记录安装过程,以便于积累经验,以及帮助各位看官少走弯路

安装

首先,需要安装python ,并且保证版本在2.6或以上,本文以版本3.6.8为例

安装python,首先要安装相关依赖包

dnf install -y gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel xz-devel

下载python源码

wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tar.xz

解压源码

tar xf Python-3.6.8.tar.xz

进入解压目录

cd Python-3.6.8

预编译配置

./configure --prefix=/usr/local/python

编译及安装

make &&  make install

导出到环境变量

echo 'export PATH=/usr/local/python/bin:$PATH' >> /etc/profile

使新的环境变量配置立即生效

source /etc/profile

查看版本

python3 -V
Python 3.6.8

第二步,安装Supervisor

[root@hcss-ecs-5eee Python-3.6.8]# yum install -y supervisor
Last metadata expiration check: 1:37:52 ago on Thu 18 Jul 2024 03:31:24 PM CST.
Dependencies resolved.
================================================================================================================================================================================
 Package                                     Architecture                            Version                                        Repository                             Size
================================================================================================================================================================================
Installing:
 supervisor                                  noarch                                  4.2.2-1.el8                                    epel                                  576 k

Transaction Summary
================================================================================================================================================================================
Install  1 Package

Total download size: 576 k
Installed size: 2.9 M
Downloading Packages:
supervisor-4.2.2-1.el8.noarch.rpm                                                                                                               2.8 MB/s | 576 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                           490 kB/s | 576 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                        1/1 
  Installing       : supervisor-4.2.2-1.el8.noarch                                                                                                                          1/1 
  Running scriptlet: supervisor-4.2.2-1.el8.noarch                                                                                                                          1/1 
[/usr/lib/tmpfiles.d/mysql.conf:23] Line references path below legacy directory /var/run/, updating /var/run/mysqld → /run/mysqld; please update the tmpfiles.d/ drop-in file accordingly.

  Verifying        : supervisor-4.2.2-1.el8.noarch                                                                                                                          1/1 

Installed:
  supervisor-4.2.2-1.el8.noarch                                                                                                                                                 

Complete!

到这里就安装完成了。