折腾:
【已解决】升级CentOS中的supervisor到最新版本
期间,已经卸载了(yum安装的)旧版本的supervisor后,去用官网:
Installing — Supervisor 3.3.4 documentation
“* Using easy_install, which is a feature of setuptools. This is the preferred method of installation.”
推荐的easy_install去安装,希望是最新版本的supervisor
对于easy_install,注意到此处CentOS服务器中是Python3.4版本的:
<code>[root@xx-general-01 robotDemo]# easy_install --version setuptools 39.0.1 from /usr/lib/python3.4/site-packages (Python 3.4) [root@xx-general-01 robotDemo]# which easy_install /usr/bin/easy_install [root@xx-general-01 robotDemo]# ll /usr/lib/python3.4/site-packages/ total 280 drwxr-xr-x 3 root root 4096 Mar 23 14:20 certifi drwxr-xr-x 2 root root 4096 Mar 23 14:20 certifi-2018.1.18.dist-info drwxr-xr-x 4 root root 4096 Mar 23 14:20 chardet drwxr-xr-x 2 root root 4096 Mar 23 14:20 chardet-3.0.4.dist-info drwxr-xr-x 3 root root 4096 Mar 23 14:20 cssselect drwxr-xr-x 2 root root 4096 Mar 23 14:20 cssselect-1.0.3.dist-info -rw-r--r-- 1 root root 195 Mar 23 14:21 easy-install.pth -rw-r--r-- 1 root root 126 Mar 23 14:20 easy_install.py drwxr-xr-x 4 root root 4096 Feb 4 23:09 et_xmlfile drwxr-xr-x 2 root root 4096 Feb 4 23:09 et_xmlfile-1.0.1-py3.4.egg-info drwxr-xr-x 3 root root 4096 Mar 23 14:20 fire drwxr-xr-x 2 root root 4096 Mar 23 14:20 fire-0.1.3-py3.4.egg-info drwxr-xr-x 3 root root 4096 Mar 23 14:20 idna drwxr-xr-x 2 root root 4096 Mar 23 14:20 idna-2.6.dist-info drwxr-xr-x 2 root root 4096 Feb 4 23:09 jdcal-1.3-py3.4.egg-info -rw-r--r-- 1 root root 12556 Sep 19 2016 jdcal.py drwxr-xr-x 21 root root 4096 Feb 4 23:09 openpyxl drwxr-xr-x 2 root root 4096 Feb 4 23:09 openpyxl-2.5.0-py3.4.egg-info drwxr-xr-x 5 root root 4096 Apr 24 11:03 pip drwxr-xr-x 2 root root 4096 Apr 24 11:03 pip-10.0.1.dist-info drwxr-xr-x 5 root root 4096 Mar 23 14:21 pkg_resources drwxr-xr-x 2 root root 4096 Mar 23 14:21 __pycache__ drwxr-xr-x 3 root root 4096 Mar 23 14:20 pyquery drwxr-xr-x 2 root root 4096 Mar 23 14:20 pyquery-1.4.0.dist-info drwxr-xr-x 3 root root 4096 Mar 23 14:20 requests drwxr-xr-x 2 root root 4096 Mar 23 14:20 requests-2.18.4.dist-info drwxr-xr-x 6 root root 4096 Mar 23 14:21 setuptools drwxr-xr-x 2 root root 4096 Mar 23 14:21 setuptools-39.0.1.dist-info -rw-r--r-- 1 root root 28 Dec 7 21:12 setuptools.pth drwxr-xr-x 2 root root 4096 Mar 23 14:20 six-1.11.0.dist-info -rw-r--r-- 1 root root 30888 Mar 23 14:20 six.py drwxr-xr-x 6 root root 4096 Mar 23 14:20 urllib3 drwxr-xr-x 2 root root 4096 Mar 23 14:20 urllib3-1.22.dist-info drwxr-xr-x 2 root root 4096 Dec 7 21:14 virtualenv-15.1.0.dist-info -rw-r--r-- 1 root root 99021 Dec 7 21:14 virtualenv.py drwxr-xr-x 3 root root 4096 Dec 7 21:14 virtualenv_support </code>
然后发现其实此处也有2.7版本的:
<code>[root@xx-general-01 robotDemo]# ll /usr/bin/easy_install* -rwxr-xr-x 1 root root 234 Mar 23 14:21 /usr/bin/easy_install -rwxr-xr-x 1 root root 234 Oct 15 2017 /usr/bin/easy_install-2.7 -rwxr-xr-x 1 root root 234 Mar 23 14:21 /usr/bin/easy_install-3.4 [root@xx-general-01 robotDemo]# ll /usr/lib/python2.7/site-packages/ total 1048 drwxr-xr-x 2 root root 4096 Oct 15 2017 argparse-1.4.0.dist-info -rw-r--r-- 1 root root 89214 Oct 15 2017 argparse.py -rw-r--r-- 1 root root 65893 Oct 15 2017 argparse.pyc drwxr-xr-x 3 root root 4096 Oct 15 2017 backports drwxr-xr-x 2 root root 4096 Oct 15 2017 backports.ssl_match_hostname-3.4.0.2-py2.7.egg-info drwxr-xr-x 2 root root 4096 Oct 15 2017 certifi drwxr-xr-x 2 root root 4096 Oct 15 2017 certifi-2017.7.27.1.dist-info drwxr-xr-x 3 root root 4096 Oct 15 2017 chardet drwxr-xr-x 2 root root 4096 Oct 15 2017 chardet-3.0.4.dist-info drwxr-xr-x 7 root root 4096 Oct 15 2017 Cheetah drwxr-xr-x 2 root root 4096 Oct 15 2017 Cheetah-2.4.4-py2.7.egg-info drwxr-xr-x 5 root root 4096 Oct 15 2017 cloud_init-0.7.6-py2.7.egg -rw-r--r--. 1 root root 2135 Jun 10 2014 configobj-4.7.2-py2.7.egg-info -rw-r--r--. 1 root root 88163 Feb 28 2010 configobj.py -rw-r--r--. 2 root root 66278 Jun 10 2014 configobj.pyc -rw-r--r--. 2 root root 66278 Jun 10 2014 configobj.pyo drwxr-xr-x 2 root root 4096 May 8 11:35 cssselect drwxr-xr-x 2 root root 4096 May 8 11:35 cssselect-1.0.3.dist-info drwxr-xr-x. 2 root root 4096 Oct 15 2017 decorator-3.4.0-py2.7.egg-info -rw-r--r--. 1 root root 10639 Oct 18 2012 decorator.py -rw-r--r--. 1 root root 8563 Jun 10 2014 decorator.pyc -rw-r--r--. 1 root root 8516 Jun 10 2014 decorator.pyo -rw-r--r-- 1 root root 29 Oct 15 2017 easy-install.pth -rw-r--r-- 1 root root 126 Oct 15 2017 easy_install.py -rw-r--r-- 1 root root 315 Oct 15 2017 easy_install.pyc drwxr-xr-x 2 root root 4096 May 8 11:35 fire drwxr-xr-x 2 root root 4096 May 8 11:35 fire-0.1.3-py2.7.egg-info drwxr-xr-x. 5 root root 4096 Oct 15 2017 firewall drwxr-xr-x 2 root root 4096 Oct 15 2017 idna drwxr-xr-x 2 root root 4096 Oct 15 2017 idna-2.6.dist-info drwxr-xr-x. 2 root root 4096 Oct 15 2017 iniparse -rw-r--r--. 1 root root 1083 Jun 10 2014 iniparse-0.4-py2.7.egg-info drwxr-xr-x 2 root root 4096 Oct 15 2017 jsonpatch-1.16.dist-info -rw-r--r-- 1 root root 26823 Oct 15 2017 jsonpatch.py -rw-r--r-- 1 root root 26801 Oct 15 2017 jsonpatch.pyc drwxr-xr-x 2 root root 4096 Oct 15 2017 jsonpointer-1.12.dist-info -rw-r--r-- 1 root root 9257 Oct 15 2017 jsonpointer.py -rw-r--r-- 1 root root 9876 Oct 15 2017 jsonpointer.pyc drwxr-xr-x 3 root root 4096 Oct 15 2017 markdown drwxr-xr-x 2 root root 4096 Oct 15 2017 Markdown-2.6.9-py2.7.egg-info drwxr-xr-x 2 root root 4096 Oct 15 2017 markupsafe drwxr-xr-x 2 root root 4096 Oct 15 2017 MarkupSafe-1.0-py2.7.egg-info drwxr-xr-x 2 root root 4096 Apr 24 11:05 meld3 drwxr-xr-x 2 root root 4096 Apr 24 11:05 meld3-1.0.2.dist-info drwxr-xr-x 2 root root 4096 Oct 15 2017 oauth drwxr-xr-x 2 root root 4096 Oct 15 2017 oauth-1.0.1-py2.7.egg-info drwxr-xr-x 4 root root 4096 Apr 24 11:05 pip drwxr-xr-x 2 root root 4096 Apr 24 11:05 pip-10.0.1.dist-info drwxr-xr-x 4 root root 4096 Oct 15 2017 pkg_resources drwxr-xr-x 2 root root 4096 Oct 15 2017 prettytable-0.7.2-py2.7.egg-info -rw-r--r-- 1 root root 54204 Oct 15 2017 prettytable.py -rw-r--r-- 1 root root 51596 Oct 15 2017 prettytable.pyc drwxr-xr-x. 2 root root 4096 Oct 15 2017 procfs drwxr-xr-x 2 root root 4096 May 8 11:35 pyquery drwxr-xr-x 2 root root 4096 May 8 11:35 pyquery-1.4.0.dist-info -rw-r--r--. 1 root root 350 Nov 6 2016 python_linux_procfs-0.4.9-py2.7.egg-info drwxr-xr-x. 2 root root 4096 Oct 15 2017 pyudev drwxr-xr-x. 2 root root 4096 Oct 15 2017 pyudev-0.15-py2.7.egg-info drwxr-xr-x 2 root root 4096 Oct 15 2017 requests drwxr-xr-x 2 root root 4096 Oct 15 2017 requests-2.18.4.dist-info drwxr-xr-x. 2 root root 4096 Mar 20 21:49 rpmUtils drwxr-xr-x 4 root root 4096 Oct 15 2017 setuptools drwxr-xr-x 2 root root 4096 Oct 15 2017 setuptools-36.5.0.dist-info drwxr-xr-x 2 root root 4096 May 8 11:35 six-1.11.0.dist-info -rw-r--r-- 1 root root 30888 May 8 11:35 six.py -rw-r--r-- 1 root root 30370 May 8 11:35 six.pyc drwxr-xr-x. 5 root root 4096 Oct 15 2017 slip -rw-r--r--. 1 root root 196 Jun 10 2014 slip-0.4.0-py2.7.egg-info -rw-r--r--. 1 root root 269 Jun 10 2014 slip.dbus-0.4.0-py2.7.egg-info drwxr-xr-x. 12 root root 4096 Mar 20 21:49 tuned drwxr-xr-x. 2 root root 4096 Oct 15 2017 urlgrabber -rw-r--r--. 1 root root 2265 Nov 6 2016 urlgrabber-3.10-py2.7.egg-info drwxr-xr-x 5 root root 4096 Oct 15 2017 urllib3 drwxr-xr-x 2 root root 4096 Oct 15 2017 urllib3-1.22.dist-info -rw-r--r--. 1 root root 46303 Jun 10 2014 validate.py -rw-r--r--. 2 root root 46711 Jun 10 2014 validate.pyc -rw-r--r--. 2 root root 46711 Jun 10 2014 validate.pyo drwxr-xr-x. 2 root root 4096 Mar 20 21:49 yum </code>
先不管了,直接用此处的python3.4的easy_install去安装
安装之前,先去找找,如何easy_install查找supervisor的版本
easy_install search version
Easy Install — setuptools 39.2.0 documentation
<code>[root@xx-general-01 robotDemo]# easy_install --help Global options: --verbose (-v) run verbosely (default) --quiet (-q) run quietly (turns verbosity off) --dry-run (-n) don't actually do anything --help (-h) show detailed help message --no-user-cfg ignore pydistutils.cfg in your home directory Options for 'easy_install' command: --prefix installation prefix --zip-ok (-z) install package as a zipfile --multi-version (-m) make apps have to require() a version --upgrade (-U) force upgrade (searches PyPI for latest versions) --install-dir (-d) install package to DIR --script-dir (-s) install scripts to DIR --exclude-scripts (-x) Don't install scripts --always-copy (-a) Copy all needed packages to install dir --index-url (-i) base URL of Python Package Index --find-links (-f) additional URL(s) to search for packages --build-directory (-b) download/extract/build in DIR; keep the results --optimize (-O) also compile with optimization: -O1 for "python - O", -O2 for "python -OO", and -O0 to disable [default: -O0] --record filename in which to record list of installed files --always-unzip (-Z) don't install as a zipfile, no matter what --site-dirs (-S) list of directories where .pth files work --editable (-e) Install specified packages in editable form --no-deps (-N) don't install dependencies --allow-hosts (-H) pattern(s) that hostnames must match --local-snapshots-ok (-l) allow building eggs from local checkouts --version print version information and exit --no-find-links Don't load find-links defined in packages being installed --user install in user site-package '/root/.local/lib/python3.4/site-packages' usage: easy_install [options] requirement_or_url ... or: easy_install --help [root@xx-general-01 robotDemo]# </code>
好像没有search
Python : Easy_Install Package Manager
python – Does easy_install provide search command? – Stack Overflow
PyPI – the Python Package Index · PyPI
https://pypi.org/search/?q=supervisor
是:
supervisor 3.3.4
3.3.4 (2018-02-15)
所以就可以去安装了。
<code>[root@xx-general-01 robotDemo]# easy_install supervisor Searching for supervisor Reading http://mirrors.aliyun.com/pypi/simple/supervisor/ Downloading http://mirrors.aliyun.com/pypi/packages/44/60/698e54b4a4a9b956b2d709b4b7b676119c833d811d53ee2500f1b5e96dc3/supervisor-3.3.4.tar.gz#md5=f1814d71d820ddfa8c86d46a72314cec Best match: supervisor 3.3.4 Processing supervisor-3.3.4.tar.gz Writing /tmp/easy_install-5z82v0b9/supervisor-3.3.4/setup.cfg Running supervisor-3.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5z82v0b9/supervisor-3.3.4/egg-dist-tmp-ky9c2nbb Supervisor requires Python 2.4 or later but does not work on any version of Python 3. You are using version 3.4.5 (default, Dec 11 2017, 14:22:24) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]. Please install using a supported version.error: Setup script exited with 1 </code>
然后是不支持python3
-》看来前面注意到 ,此处easy_install是python3,还是有影响的。
看来只能换用pip,且是python2的pip去安装了
<code>[root@xx-general-01 robotDemo]# ll /usr/bin/pip* -rwxr-xr-x 1 root root 216 Apr 24 11:05 /usr/bin/pip -rwxr-xr-x 1 root root 216 Apr 24 11:05 /usr/bin/pip2 -rwxr-xr-x 1 root root 216 Apr 24 11:05 /usr/bin/pip2.7 -rwxr-xr-x 1 root root 216 Apr 24 11:03 /usr/bin/pip3.4 [root@xx-general-01 robotDemo]# pip --version pip 10.0.1 from /usr/lib/python2.7/site-packages/pip (python 2.7) </code>
然后去安装
然后也是,pip中先去看看,能否支持search,查看到要安装的supevisor的版本是多少
pip search
pip search — pip 10.0.1 documentation
searching for available python packages pip – Stack Overflow
<code>[root@xx-general-01 robotDemo]# pip search supervisor supervisor-haproxy (1.1.0) - supervisor eventlistener for notifying haproxy supervisor-serialrestart (0.1.1) - Adds serialrestart command to Supervisor. supervisor-healthcheck (0.8.0) - Framework to build health checks for Supervisor-based services, based on supervisor-checks supervisor-alert (0.6.2) - Receive notifications for Supervisor process events. supervisor-confator (0.3.0) - Python interface to generate supervisor configuration files. supervisor-quick (0.1.4) - Bypass supervisor's nasty callbacks stack and make it quick! supervisor-wildcards (0.1.3) - Implemenents start/stop/restart commands with both parallel and wildcard support for Supervisor. supervisor-event-listeners (0.1) - A small collection of supervisor event listeners. supervisor-logstash-notifier (0.2.5) - Stream supervisor events to a logstash instance supervisor (3.3.4) - A system for controlling process state under UNIX wsgi-supervisor (0.0.2) - reload wsgi app on file change supervisor-logging (0.0.9) - Stream supervisord logs to a syslog instance supervisor-stdout (0.1.1) - UNKNOWN me2-supervisor (0.0.9) - me2 is a mOSAIC Cloud Project component responsible for the deployment and supervision of application django-supervisor (0.4.0) - easy integration between djangocl and supervisord supervisor-logging-gelf (0.0.1) - Stream supervisord logs to a Graylog instance supervisor-plus-cron (1.0.15201) - From 4.0.0.dev0: A system for controlling process state under UNIX, plus CRON! ajenti.plugin.supervisor (0.15) - Supervisor svdlib (0.0.2) - supervisor manager simplevisor (1.2) - Simple daemon supervisor SupervisorAdmin (0.1) - add supervisor jobs jb.recipe.supervisor (0.0.1) - Recipe for installing Supervisor mr.laforge (0.6) - Plugins and utilities for supervisor ramona (1.0.0) - Enterprise-grade runtime supervisor supergauge (0.0.2) - supervisor process gauge eventlistener supermann (3.2.0) - A Supervisor event listener for Riemann supervisor_cache (1.1.0) - supervisor_cache RPC extension for supervisor supervisor_twiddler (1.0.0) - supervisor_twiddler RPC extension for Supervisor suponoff (0.1) - An alternative Supervisor web interface. mannhunter (0.0.0-dev) - A memory limiting tool for Supervisor multivisor (4.1.3) - A centralized supervisor web UI fourdigits.recipe.supervisor (0.18dev) - A buildout recipe to install supervisor collective.recipe.supervisor (0.20) - A buildout recipe to install supervisor weberWinSV (0.0.18) - Supervisor for Windows wrote by Weber Juche. supervise (1.1.1) - Tools for communicating with runit / daemontools supervisors. supervisoragent (0.0.1.dev2) - An agent for monitoring applications run by supervisor svdog (0.2.1) - supervisor's dog, should deploy with flylog django-fagungis (0.1) - DJANGO + FAbric + GUnicorn + NGInx + Supervisor deployment birdhousebuilder.recipe.supervisor (0.4.0) - A Buildout recipe to install and configure supervisor for Anaconda. superfsmon (1.1.1) - Supervisor plugin to watch a directory and restart programs on changes supervisorc (0.1.0) - A high level api for XML-RPC supervisor server supervisor_checks (0.7.0) - Framework to build health checks for Supervisor-based services. hostout.supervisor (1.0a5) - Plugin for collective.hostout that starts and stops supervisor during deployment dreipol-django-fagungis (0.0.21) - DJANGO + FAbric + GUnicorn + NGInx + Supervisor deployment for dreipol QSupervisorControl (0.3.8) - The simples tray system that observe status of services managed with supervisor. gos (0.1.3) - Generically organizable supervisor to create multi-level executable pipelines visorlog (0.0.1) - Logging for supervisor child processes using the python standard logging module. supervisor_newrelic (1.0.10) - Collection of Supervisor plugins to provide metrics and monitoring within New Relic Propel (0.60.1) - A package to deploy sites in virtualenv, run scripts, and deploy workers with supervisor Deployapp (0.20.0) - A package to deploy sites in virtualenv, run scripts, and deploy workers with supervisor GANDS (1.0) - Deploying a web application that works with (Django, Amazon EC2, Gunicorn, Supervisor, Nginx) supervisorclusterctl (0.1.2) - supervisorclusterctl is a cmd line tool that allows to control a cluster of processes by utilizing Supervisor and Ansible. trident-resin-proxy (1.2.0) - Python REST API that acts as a proxy to the Resin Supervisor API and Resin Data API djangovisor (0.9) - This app collects data from supervisor instances on one or multiple servers, stores and visualizes it. cmdtwiddler (1.2.0) - Small wrapper for twiddler to add and remove supervisor processes on the fly from the command line [root@xx-general-01 robotDemo]# </code>
看到了:
supervisor (3.3.4) – A system for controlling process state under UNIX
是最新的3.3.4
去安装
<code>[root@xx-general-01 robotDemo]# pip install supervisor Looking in indexes: http://mirrors.aliyun.com/pypi/simple/ Collecting supervisor Downloading http://mirrors.aliyun.com/pypi/packages/44/60/698e54b4a4a9b956b2d709b4b7b676119c833d811d53ee2500f1b5e96dc3/supervisor-3.3.4.tar.gz (419kB) 100% |████████████████████████████████| 419kB 79.9MB/s Requirement already satisfied: meld3>=0.6.5 in /usr/lib64/python2.7/site-packages (from supervisor) (0.6.10) Installing collected packages: supervisor Running setup.py install for supervisor ... done Successfully installed supervisor-3.3.4 [root@xx-general-01 robotDemo]# pip --help Usage: pip <command> [options] Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. config Manage local and global configuration. search Search PyPI for packages. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. help Show help for commands. General Options: -h, --help Show help. --isolated Run pip in an isolated mode, ignoring environment variables and user configuration. -v, --verbose Give more output. Option is additive, and can be used up to 3 times. -V, --version Show version and exit. -q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels). --log <path> Path to a verbose appending log. --proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port. --retries <retries> Maximum number of retries each connection should attempt (default 5 times). --timeout <sec> Set the socket timeout (default 15 seconds). --exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort). --trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS. --cert <path> Path to alternate CA bundle. --client-cert <path> Path to SSL client certificate, a single file containing the private key and the certificate in PEM format. --cache-dir <dir> Store the cache data in <dir>. --no-cache-dir Disable the cache. --disable-pip-version-check Don't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index. --no-color Suppress colored output [root@xx-general-01 robotDemo]# pip show supervisor Name: supervisor Version: 3.3.4 Summary: A system for controlling process state under UNIX Home-page: http://supervisord.org/ Author: Chris McDonough Author-email: [email protected] License: BSD-derived (http://www.repoze.org/LICENSE.txt) Location: /usr/lib/python2.7/site-packages Requires: meld3 Required-by: [root@xx-general-01 robotDemo]# </code>
<code>[root@xx-general-01 robotDemo]# supervisord --version 3.3.4 [root@xx-general-01 robotDemo]# which supervisord /usr/bin/supervisord [root@xx-general-01 robotDemo]# which supervisorctl /usr/bin/supervisorctl </code>
【总结】
此处的CentOS中,(不知何故)easy_install是python 3.4的,而由于supervisor暂时不支持Python3,所以去安装会失败,提示不支持。
此处只能换用python 2的pip去安装才可以。
<code>pip install supervisor </code>
安装完毕后,看看版本:
<code>pip show supervisor </code>