Linux上独立运行supervisor

2021年10月26日 23:05 by scott

服务部署

问题

非root用户默认无法使用supervisor,因为普通用户是不能通过apt-get install supervisor 或 yum install supervisor安装supervisor的。

解决方案

既然supervisor是python实现的,那么在python虚拟环境中是可以直接安装的。

假如有一个通过conda创建的虚拟环境crawl,实现的具体步骤如下:

1. 启动虚拟环境:

conda activate crawl

2. 安装supervisor:

pip install supervisor

3.  创建supervisor的工作目录:

mkdir -m 755 -p /home/txwst/supervisor

4. 进入工作目录后,生成默认配置文件supervisor.conf:

echo_supervisord_conf > supervisord.conf

5. 修改配置文件的最后两行为如下内容:

[include]
files = ./conf.d/*.ini

记得在工作目录下创建conf.d目录,用于存放各程序的配置

6. 启动supervisord服务:

~/.conda/envs/crawl/bin/supervisord -c /home/txwst/supervisor/supervisord.conf -d /home/txwst/supervisor -q /home/txwst/supervisor

 

测试supervisor服务

1. 在目录/home/txwst/supervisor/conf.d下创建scrapyd的配置文件scrapyd.ini;

前提是已在crawl环境中安装了scrapyd

具体内容为:

[program:scrapyd]
directory=/home/txwst/scrapyd
command=/home/txwst/.conda/envs/crawl/bin/scrapyd
autostart=true
autorestart=true
startsecs=5

stderr_logifle=/tmp/scrapyd_stderr.log
stdout_logfile=/tmp/scrapyd_stdout.log
redirect_stderr=true
stdout_logfile_maxbytes=20MB
stdout_logfile_backups=10

2. 重新载入supervisor配置:

~/.conda/envs/crawl/bin/supervisorctl -c /home/txwst/supervisor/supervisord.conf reload

3. 测试scrapyd是否启动:

[txwst@tx01 ~]$ curl localhost:6800

<html>
<head><title>Scrapyd</title></head>
<body>
<h1>Scrapyd</h1>
<p>Available projects: <b></b></p>
<ul>
<li><a href="/jobs">Jobs</a></li>

<li><a href="/logs/">Logs</a></li>
<li><a href="http://scrapyd.readthedocs.org/en/latest/">Documentation</a></li>
</ul>

<h2>How to schedule a spider?</h2>

<p>To schedule a spider you need to use the API (this web UI is only for
monitoring)</p>

<p>Example using <a href="http://curl.haxx.se/">curl</a>:</p>
<p><code>curl http://localhost:6800/schedule.json -d project=default -d spider=somespider</code></p>

<p>For more information about the API, see the <a href="http://scrapyd.readthedocs.org/en/latest/">Scrapyd documentation</a></p>
</body>
</html>

总结

这里通过在虚拟环境中安装supervisor,然后自己创建配置文件,并启动相应服务,最终完成supervisor在独立环境中运行的目标。

如有其他问题,欢迎留言。


Comments(126) Add Your Comment

Wpthko
buy atorvastatin <a href="https://lipiws.top/">lipitor 40mg sale</a> atorvastatin 40mg tablet
Ndvugj
buy cipro no prescription - <a href="https://metroagyl.top/">cipro online order</a> generic augmentin
Dpfzad
cipro 500mg over the counter - <a href="https://cipropro.top/augmentin500/">brand clavulanate</a> amoxiclav brand
Xlbnme
flagyl canada - <a href="https://metroagyl.top/clindamycin/">purchase cleocin sale</a> how to buy zithromax
Fffonz
order ciprofloxacin 500mg sale - <a href="https:/septrim.top/">purchase ciprofloxacin generic</a> erythromycin 250mg brand
Qagmsv
buy generic valacyclovir 500mg - <a href="https://gnantiviralp.com/zovirax/">purchase acyclovir online</a> zovirax generic
Ffiglh
ivermectin 6 mg stromectol - <a href="https://keflexin.top/aczone/">order aczone without prescription</a> sumycin 500mg cost
Ppkssp
flagyl brand - <a href="https://metroagyl.top/">buy flagyl 400mg online</a> order zithromax without prescription
Kbgpzt
ampicillin brand <a href="https://ampiacil.top/penicillinused/">penicillin uk</a> brand amoxil
Dwztfb
furosemide usa - <a href="https://antipathogenc.com/">lasix price</a> buy capoten 25 mg
Xtkupo
glucophage where to buy - <a href="https://gnantiacidity.com/lincocin/">order lincomycin 500 mg sale</a> lincomycin 500 mg oral
Prjihx
order zidovudine for sale - <a href="https://canadiangnp.com/zyloprim/"></a> allopurinol 300mg us
Jvttjj
order generic clozapine - <a href="https://genonlinep.com/accupril/">buy accupril 10mg generic</a> famotidine 40mg ca
Bnnkbd
buy seroquel generic - <a href="https://gnkantdepres.com/effexor/">order venlafaxine sale</a> order eskalith
Mdejki
order anafranil 50mg without prescription - <a href="https://antdeponline.com/cymbalta/">order cymbalta pills</a> buy doxepin 25mg online
Izqdns
purchase hydroxyzine online - <a href="https://antdepls.com/">hydroxyzine cost</a> generic endep 10mg
Yvrpax
buy amoxil pills for sale - <a href="https://atbioxotc.com/ceftin/">cost ceftin 500mg</a> buy cipro 500mg without prescription
Rmmnqi
buy generic clavulanate for sale - <a href="https://atbioinfo.com/linezolid/">zyvox brand</a> baycip buy online
Zpmipr
order cleocin generic - <a href="https://cadbiot.com/cefpodoxime/">buy cefpodoxime medication</a> chloramphenicol online order
Dcxgjr
purchase zithromax sale - <a href="https://gncatbp.com/">buy azithromycin for sale</a> order ciplox 500mg online cheap
Uhiqji
albuterol 4mg generic - <a href="https://antxallergic.com/oiphenergan/">promethazine 25mg us</a> theo-24 Cr pill
Nlsyuh
ivermectin generic - <a href="https://antibpl.com/szdoryx/">doryx buy online</a> buy generic cefaclor 500mg
Leimjg
desloratadine for sale online - <a href="https://rxtallerg.com/ventolinpill/">purchase albuterol online</a> buy albuterol no prescription
Ofiqua
buy generic medrol over the counter - <a href="https://ntallegpl.com/getcetirizine/">cetirizine medication</a> purchase astelin without prescription
Yiwjbl
order micronase 2.5mg online cheap - <a href="https://prodeprpl.com/">glyburide over the counter</a> purchase dapagliflozin
Cvpgve
repaglinide cheap - <a href="https://depressinfo.com/jardiance25/">empagliflozin pill</a> empagliflozin 25mg tablet
Dtcrgo
order metformin 1000mg online cheap - <a href="https://arxdepress.com/sitagliptin50/">order generic januvia 100 mg</a> order generic acarbose
Vwbcrs
buy terbinafine - <a href="https://treatfungusx.com/xgrifulvinvs/">buy griseofulvin pills for sale</a> griseofulvin sale
Nnbbxb
buy rybelsus 14mg generic - <a href="https://infodeppl.com/glucovance5/">glucovance pill</a> order desmopressin online cheap
Ikuyrz
nizoral 200mg usa - <a href="https://antifungusrp.com/">buy nizoral 200mg without prescription</a> brand sporanox
Suckth
famciclovir 500mg without prescription - <a href="https://amvinherpes.com/gnvalaciclovir/">purchase valcivir</a> oral valaciclovir
Jifwrp
order lanoxin generic - <a href="https://blpressureok.com/avalidemed/">buy irbesartan sale</a> order furosemide 40mg without prescription
Blfclp
hydrochlorothiazide 25 mg canada - <a href="https://norvapril.com/bisoprolol/">order zebeta 10mg without prescription</a> bisoprolol over the counter
Arndzn
lopressor us - <a href="https://bloodpresspl.com/">how to get metoprolol without a prescription</a> where can i buy adalat
Fjikrs
buy nitroglycerin generic - <a href="https://nitroproxl.com/">nitroglycerin pill</a> buy diovan 160mg pills
Kczwaj
rosuvastatin online lip - <a href="https://antcholesterol.com/pravastatin/">pravastatin snore</a> caduet scowl
Hihmex
simvastatin granny - <a href="https://canescholest.com/">buy simvastatin 10mg pill</a> lipitor accomplish
Zocoud
viagra professional online two - <a href="https://edsildps.com/malegra/">malegra square</a> levitra oral jelly online await
Wbijzq
priligy nail - <a href="https://promedprili.com/suhagra/">suhagra pilot</a> cialis with dapoxetine midnight
Jxldon
cenforce online whence - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra online healthy</a> brand viagra nose
Qgoqoo
brand cialis bond - <a href="https://probrandtad.com/">brand cialis hover</a> penisole another
Bjjvgj
cialis soft tabs online son - <a href="https://supervalip.com/viagraoraljelly/">viagra oral jelly pavement</a> viagra oral jelly alive
Vhfmbo
brand cialis ministry - <a href="https://probrandtad.com/brandlevitra/">brand levitra sheet</a> penisole wet
Qqetqg
cialis soft tabs pills belief - <a href="https://supervalip.com/levitrasoft/">levitra soft society</a> viagra oral jelly online practical
Fgyidy
cenforce online careless - <a href="https://xcenforcem.com/brandviagrasildenafil/">brand viagra online winter</a> brand viagra situation
Wtnryy
priligy moan - <a href="https://promedprili.com/levitrawithdapoxetine/">levitra with dapoxetine bottle</a> cialis with dapoxetine passion
Mhodol
acne medication supple - <a href="https://placnemedx.com/">acne treatment worse</a> acne treatment restore
Hwynbg
asthma medication stir - <a href="https://bsasthmaps.com/">asthma medication shelter</a> asthma medication expensive
Txackm
treatment for uti shutter - <a href="https://amenahealthp.com/">uti treatment energy</a> treatment for uti give
Jkydnx
prostatitis treatment fully - <a href="https://xprosttreat.com/">prostatitis medications dozen</a> pills for treat prostatitis complete
Vjbjih
valtrex blossom - <a href="https://gnantiviralp.com/">valtrex design</a> valtrex pills health
Kaputu
loratadine medication thank - <a href="https://clatadine.top/">claritin pills draw</a> claritin pills flare
Cltigw
claritin stick - <a href="https://clatadine.top/">claritin pills platform</a> loratadine medication unseen
Vfbcca
priligy entity - <a href="https://prilixgn.top/">dapoxetine operation</a> dapoxetine camera
Zlcwyh
promethazine information - <a href="https://prohnrg.com/">promethazine watson</a> promethazine obscure
Tftral
ascorbic acid shire - <a href="https://ascxacid.com/">ascorbic acid without</a> ascorbic acid your
Ecmqyq
clarithromycin pills become - <a href="https://gastropls.com/">clarithromycin resolve</a> cytotec favourite
Khgfnn
florinef air - <a href="https://gastroplusp.com/">fludrocortisone fever</a> lansoprazole screen
Lslmne
bisacodyl 5mg for sale - <a href="https://gastroinfop.com/oxybutynin/">oxybutynin drug</a> buy generic liv52
Luvpvo
order aciphex 20mg sale - <a href="https://gastrointesl.com/domperidone/">motilium generic</a> purchase motilium online cheap
Owdhuy
cotrimoxazole over the counter - <a href="https://ketiracet.com/">levetiracetam pills</a> tobra 5mg us
Gcqksc
buy generic hydroquinone online - <a href="https://dupsteron.com/">order dydrogesterone generic</a> buy dydrogesterone 10mg online
Cifmqf
order dapagliflozin 10 mg for sale - <a href="https://forpaglif.com/">cheap forxiga 10 mg</a> acarbose where to buy
Pxmvzd
buy fulvicin online cheap - <a href="https://fulviseoful.com/">buy griseofulvin 250 mg generic</a> gemfibrozil 300mg price
Eeoikn
order vasotec 10mg pills - <a href="https://xalanoprost.com/">latanoprost online buy</a> order generic xalatan
Qfczzi
order generic dramamine 50mg - <a href="https://actodronate.com/">order risedronate 35 mg pills</a> risedronate uk
Nfasvq
order piroxicam generic - <a href="https://rivastilons.com/">exelon 6mg pills</a> buy generic rivastigmine 3mg
Iijsei
buy etodolac 600 mg for sale - <a href="https://cilosetal.com/">buy cilostazol 100mg generic</a> cilostazol 100mg pills
Bkmyob
piracetam sale - <a href="https://nootquin.com/">buy nootropil 800mg for sale</a> sinemet 10mg pills
Axcxnb
order hydroxyurea pills - <a href="https://hydroydrinfo.com/indinavir/">order crixivan online cheap</a> robaxin pills
Hmqxgm
divalproex 250mg drug - <a href="https://adepamox.com/">depakote 500mg usa</a> order topamax online
Ctkzvm
buy norpace generic - <a href="https://anorpica.com/">buy disopyramide phosphate online</a> purchase thorazine
Uwyqmh
where can i buy cyclophosphamide - <a href="https://cycloxalp.com/atomoxetine/">atomoxetine tablet</a> vastarel online
Txmibs
order generic aldactone - <a href="https://aldantinep.com/phenytoin/">buy phenytoin cheap</a> naltrexone for sale online
Crttpv
generic cyclobenzaprine 15mg - <a href="https://abflequine.com/">order flexeril</a> vasotec 5mg uk
Oyydee
oral ondansetron 8mg - <a href="https://azofarininfo.com/">ondansetron online</a> requip 1mg us
Mcvyxp
ascorbic acid sale - <a href="https://mdacidinfo.com/ciprofloxacin/">buy generic ciprodex ophthalmic solution over the counter</a> buy compro online
Ammdym
order durex gel sale - <a href="https://xalaplinfo.com/">durex gel online order</a> purchase latanoprost eye drops
Edzmgu
leflunomide 20mg for sale - <a href="https://infohealthybones.com/cartidin/">where can i buy cartidin</a> where to buy cartidin without a prescription
Bklxqw
buy minoxidil paypal - <a href="https://mdacidinfo.com/dutasteride/">dutas without prescription</a> buy finasteride
Fphpeh
buy tenormin 50mg for sale - <a href="https://heartmedinfox.com/clopidogrel/">cheap clopidogrel 75mg</a> buy carvedilol 6.25mg pills
Trfsxe
buy verapamil for sale - <a href="https://infoheartdisea.com/atenolol/">tenoretic price</a> order tenoretic
Fxcwbf
atorvastatin brand - <a href="https://infoxheartmed.com/enalapril/">order vasotec 5mg sale</a> bystolic 5mg pill
Mnyxsa
order generic lasuna - <a href="https://infoherbalmz.com/himcolin/">himcolin canada</a> himcolin price
Yfvzvd
order noroxin generic - flutamide online buy buy confido
Ormdqq
speman usa - purchase himplasia sale fincar generic
Dqmagz
cheap finax generic - order uroxatral 10mg sale uroxatral order online
Ryqpxz
terazosin without prescription - purchase avodart pills buy priligy pills
Moeynq
buy oxcarbazepine 600mg generic - cheap pirfenidone generic synthroid 150mcg sale
Nonyvi
cyclosporine order - buy methotrexate 5mg colchicine medication
Kebhsv
duphalac medication - buy lactulose bottles betahistine generic
Wnuifk
deflazacort pills - calcort for sale buy alphagan medication
Shcbdj
buy besivance - buy generic sildamax online buy generic sildamax
Kpqkni
gabapentin 800mg drug - order azulfidine 500 mg for sale azulfidine oral
Prfvay
buy probenecid 500 mg for sale - oral probalan order carbamazepine 400mg sale
Rzmfot
order celecoxib 200mg without prescription - brand flavoxate cheap indomethacin 75mg
Kgxkxv
colospa 135mg brand - oral arcoxia cilostazol 100 mg uk
Dqqzol
buy generic diclofenac 100mg - generic voltaren 50mg aspirin brand
Qtqlfa
rumalaya canada - buy shallaki online cheap endep over the counter
Ktakiw
order pyridostigmine 60 mg pills - buy generic imuran order azathioprine 50mg online cheap
Ovrpsc
voveran order - voveran without prescription nimodipine oral
Yoorpg
lioresal medication - lioresal pills order generic piroxicam
Eemolr
order meloxicam without prescription - buy generic maxalt 5mg toradol where to buy
Hyfrvo
periactin 4 mg cost - periactin 4 mg pills tizanidine for sale
Zjexpw
order trihexyphenidyl online cheap - emulgel online order purchase emulgel for sale
Qnedas
order cefdinir 300mg - buy omnicef 300 mg without prescription cleocin ca
Aqgwaa
order accutane 40mg generic - buy avlosulfon 100 mg pill buy deltasone 20mg generic
Klgszi
prednisone online order - omnacortil 5mg sale where can i buy elimite
Cbbjdo
acticin cream - benzoyl peroxide online order purchase tretinoin
Apvccu
betnovate 20gm generic - oral differin purchase benoquin cream
Fsxxfu
metronidazole pills - metronidazole 400mg pills cenforce canada
Brqfhw
augmentin pill - cheap augmentin levothyroxine sale
Nmajie
cleocin 150mg oral - cleocin 300mg for sale buy indomethacin generic
Fwygfr
purchase hyzaar online - buy keflex 125mg pill buy cephalexin online cheap
Frcyek
crotamiton for sale - crotamiton price purchase aczone without prescription
Suokzp
order zyban 150 mg online cheap - buy generic ayurslim online cheap shuddha guggulu pill
Tjisnl
xeloda 500 mg brand - danocrine 100mg without prescription danocrine over the counter
Iqthrl
how to get progesterone without a prescription - clomiphene price buy fertomid paypal
Yaionr
order fosamax 35mg online - buy fosamax 70mg generic buy medroxyprogesterone online
Edxsnt
buy generic norethindrone 5mg - buy generic lumigan for sale buy yasmin online cheap
Tuldva
buy estradiol 2mg pills - buy anastrozole no prescription anastrozole pills
Hxmvco
where can i buy dostinex - purchase cabgolin generic alesse buy online
Qrfowi
バイアグラ - 50mg/100mg - シルデナフィル 飲み方 シアリスジェネリック 通販
Lrofdt
プレドニン 値段 - プレドニン 市販 おすすめ アジスロマイシン通販 安全
Gcvapr
プレドニンの購入 - ドキシサイクリン 副作用 イソトレチノイン通販
Ehwhpg
eriacta cling - apcalis control forzest prove