In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article Xiaobian for you to introduce in detail "how to use Linux Supervisor tools", the content is detailed, the steps are clear, the details are handled properly, I hope this article "how to use Linux Supervisor tools" can help you solve your doubts, following the editor's ideas slowly in-depth, let's learn new knowledge.
Installation of Supervisor 1. After you configure the yum source, you can install it directly.
Yum install supervisor2.Debian/Ubuntu can be installed through apt
Apt-get install supervisor3.pip installation
Pip install supervisor4.easy_install installation
Easy_install supervisor I used the yum installation here
Supervisor uses the supervisor configuration file: / etc/supervisor/supervisord.conf
The file directory of my server: / etc/supervisord.conf
Note: the configuration file for supervisor is incomplete by default, but by most defaults, the basic functions mentioned above have been met.
Child process profile path: / etc/supervisord.d/
Note: the default child process configuration file is in ini format and can be modified in the supervisor main configuration file.
Profile description supervisor.conf profile description (copy):
[unix_http_server] file=/tmp/supervisor.sock; UNIX socket file, supervisorctl can use; chmod=0700; mode of socket file, default is 0700; chown=nobody:nogroup; owner of socket file, format: uid:gid; [inet_http_server]; HTTP server, which provides web management interface; port=127.0.0.1:9001 Web manages the IP and port running at the backend. If it is open to the public network, you need to pay attention to security; username=user; user name of login management backend; password=123; password of login management backend [supervisord] logfile=/tmp/supervisord.log; log file. Default is $CWD/supervisord.log logfile_maxbytes=50MB. Log file size: rotate. Default 50MB. If set to 0, the size of logfile_backups=10 is not limited. The number of reserved backups of log files defaults to 10, and 0 means no backup of loglevel=info. Log level, default info, other: debug,warn,trace pidfile=/tmp/supervisord.pid; pid file nodaemon=false Whether to start in the foreground, the default is false, that is, start minfds=1024 by daemon; the minimum value of file descriptors that can be opened, default is 1024 minprocs=200; the minimum value of the number of processes that can be opened, default is 200 [supervisorctl] serverurl=unix:///tmp/supervisor.sock; the path of connecting supervisord through UNIX socket is the same as the file of unix_http_server part; serverurl= http://127.0.0.1:9001 Connect to supervisord through HTTP; [program:xx] is the managed process configuration parameter, and xx is the name of the process [program:xx] command=/opt/apache-tomcat-8.0.35/bin/catalina.sh run; the program startup command autostart=true; and automatically starts startsecs=10 when supervisord starts If there is no abnormal exit after 10 seconds, it means that the process has started normally. The default is 1 second autorestart=true. Available values: [unexpected,true,false], default is unexpected, which means startretries=3 is restarted after the process is killed unexpectedly; number of automatic retries after startup failure, default is 3 user=tomcat; with which user to start the process, the default is root priority=999 Process startup priority: 999 by default, redirect_stderr=true with small value, redirect stderr to stdout, default false stdout_logfile_maxbytes=20MB; stdout log file size, default 50MB stdout_logfile_backups = 20; number of stdout log file backups, default is 10 Stdout log file, please note that it cannot start normally when the specified directory does not exist, so you need to create a directory manually (supervisord will automatically create a log file) stdout_logfile=/opt/apache-tomcat-8.0.35/logs/catalina.out stopasgroup=false. Default is false. When a process is killed, whether to send stop signals to this process group, including child process killasgroup=false. The default is false, which sends kill signals to the process group, including child processes, and contains other configuration files [include] files = relative/directory/*.ini. You can specify one or more configuration files ending with .ini. Child process profile description:
Write a configuration file for the child process (program) that needs to be managed, put it in the / etc/supervisor.d/ directory, use .ini as an extension, and create the blog.ini myself.
The parameter description is as above
# redis data is regularly inserted into the database [program:dbtimer] directory=/home/www/blog command=php index.php swoole/cron/index autostart=true autorestart=true stderr_logfile=/home/www/blog/timerin.log stdout_logfile=/home/www/blog/timerout.log # swoole launch [program:swoolerun] directory=/home/www/blog command=php swooleRun.php autostart=true autorestart=true stderr_logfile=/home/www/blog/swoolein.log stdout_logfile=/home/www/blog/swooleout.logsupervisor command description of common supervisor commands
Supervisorctl status / / View the status of all processes supervisorctl update / / use this command to load the new configuration supervisorctl reload / / restart all programs in the configuration supervisorctl restart / / restart specified application supervisorctl stop / / stop specified application supervisorctl start / / start specified application supervisorctl restart all / / restart all applications supervisorctl stop all / / stop Stop all applications supervisorctl start all / / start all applications supervisor start the server as centos7
Systemctl start supervisord.service / / start supervisor and load the default configuration file to read here, this article "how to use Linux Supervisor tools" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more related articles, 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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.