Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install supervisor under centos

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to install supervisor under centos. It is very detailed and has a certain reference value. Friends who are interested must finish it!

1. Install supervisor

Execute the following command

Yum install python-setuptoolseasy_install supervisor

Or

# if easy_install doesn't work, download it from the official: wget https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/supervisor-3.3.1.tar.gz# and install it through python: tar zxf supervisor-3.3.1.tar.gzcd supervisorpython setup.py install

2. Configure Supervisor

a. Create folders and configuration files

Mkdir / etc/supervisorecho_supervisord_conf > / etc/supervisor/supervisord.conf

b. Modify the contents of / etc/supervisor/supervisord.conf file

At the end of the file at the [include] node

Put; files = relative/directory/*.ini

Change to files = conf.d/*.conf

c. Execute the supervisorctl reload command to make the configuration file effective.

d. Create a conf.d folder under / etc/supervisor/, and ProjectName.conf (named after the project)

e. Open the laravel.conf file and add the following:

[program:laravel] process_name=% (program_name)% (process_num) 02dcommand=/usr/local/php/bin/php / data/wwwroot/laravel/artisan queue:listen-- tries=3autostart=trueautorestart=trueuser=wwwnumprocs=2redirect_stderr=truestdout_logfile=/data/wwwlogs/worker.log

3. Run supervisord to see if it is effective, and execute the following command:

# run supervisord-c / etc/supervisor/supervisord.conf# to view the process (ps-ef | grep ProjectName) ps-ef | grep laravel

4. Configure supervisord to boot

a. Create the file supervisord.service in the specified directory

Vim / usr/lib/systemd/system/supervisord.service

b. Enter the following:

[Unit] Description=Supervisor daemon [service] Type=forkingExecStart=/usr/bin/supervisord-c / etc/supervisor/supervisord.confExecStop=/usr/bin/supervisorctl shutdownExecReload=/usr/bin/supervisorctl reloadKillMode=processRestart=on-failureRestartSec=42s [Install] WantedBy=multi-user.target

c. Execute the following command:

Systemctl enable supervisord

d. Verify that it is booting up:

# prompt enabled to indicate successful systemctl is-enabled supervisord

5. Common commands

Service supervisord start # start service supervisord stop # stop service supervisord status # status supervisorctl shutdown # close all tasks supervisorctl stop | start program_name # start or stop service supervisorctl status # View the status of all tasks above is all about how to install supervisor under centos, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 289

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report