In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
A brief introduction to Supervisor
Supervisor is a process monitoring tool on Linux/Unix system. Supervisor is a general process management program developed by Python, which can manage and monitor processes on Linux, change an ordinary command line process into background daemon, and monitor process status, and restart automatically when an exception exits. However, like daemontools, it cannot monitor daemon processes. Yum installs supervisor yum install-y epel-release supervisor 2. Generate the configuration file echo_supervisord_conf > / etc/supervisord.conf3. Edit the configuration file ```[unix_http_server] file=/var/run/supervisor/supervisor.sock; (the path to the socket file) [inet_http_server]; inet (TCP) server disabled by defaultport=*:9001; (ip_address:port specifier, *: port for all iface) [supervisord] logfile=/var/log/supervisor/supervisord.log; (main logfile; default $CWD/supervisord.log) logfile_maxbytes=50MB; (max main logfile bytes b4 rotation Default 50MB) logfile_backups=10; (num of main logfile rotation backups;default 10) loglevel=info; (loglevel; default info; others: debug,warn,trace) pidfile=/var/run/supervisord.pid; (supervisord pidfile;default supervisord.pid) nodaemon=false; (start in foreground if true;default false) minfds=1024; (min. Avail startup file descriptors;default 1024) minprocs=200; (min. Avail process descriptors;default 200) [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_ rpcinterface [incluorctl] serverurl=unix:///var/run/supervisor/supervisor.sock; use a unix:// URL for a unix socket [include] files = / etc/supervisord.d/*.conf; pay attention to write the absolute path ```4. Start supervisord, set boot supervisord-c / etc/supervisord.conf echo "supervisord-c / etc/supervisord.conf" > > / etc/rc.local chmod + x / etc/rc.d/rc.local5. Visit supervisor's web interface http://ip:90016. Add the configuration file for the management process and store it in / etc/supervisord.d/ ```[program:elasticsearch] command = / usr/local/elasticsearch/bin/elasticsearch; the startup directory user=elk of the program; the user to start priority=10; priority. The lower the default number is, the higher the priority is. Start several processes autostart=true; start autorestart=true with the start of supervisord; automatically restart startrestries=3 after abnormal exit; redirect_stderr=true the maximum number of retries if startup fails; redirect stderr to stdoutstdout_logfile_maxbytes = 20MB Stdout log file size, default 50MBstdout_logfile_backups = 10; number of stdout log file backups stdout_logfile = / home/logs/supervisor/elasticsearch_stdout.log; log file ```figure:
Introduction to Cesi CeSi is a Web UI officially recommended by Supervisor for centralized management of Supervisor instances. The tool is written in Python and is based on the Flask Web framework. The Web UI included in Superviosr does not support cross-machine management of Supervisor processes, and the function is relatively simple. You can centrally manage the processes of each server node through CeSi, and you can easily manage the startup, shutdown and restart of various services in the Web interface, which is very convenient to use. 1. Installation depends on yum install-y git wget epel-release python34 python34-pip npm bzip2 npm install-g n (upgrade node to the latest version) n latest curl-- silent-- location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee / etc/yum.repos.d/yarn.repo yum install-y yarn (install yarn) 2. Install cesi (refer to the official website tutorial) ```export CESI_SETUP_PATH=/opt/cesi
Mkdir ${CESI_SETUP_PATH}
Cd ${CESI_SETUP_PATH}
Wget https://github.com/gamegos/cesi/releases/download/v2.6.7/cesi-extended.tar.gz-O cesi.tar.gz
Tar-xvf cesi.tar.gz
Python3-m venv venv
Source venv/bin/activate
Pip3 install-r requirements.txt
Deactivate
Cd ${CESI_SETUP_PATH} / cesi/ui
Yarn install
Yarn build
Pay attention to modifying / etc/cesi.conf.toml and / etc/systemd/system/cesi.service
Cp ${CESI_SETUP_PATH} / defaults/cesi.conf.toml / etc/cesi.conf.toml
Vi / etc/cesi.conf.toml
[cesi]
Database = "sqlite:///users.db" # Relative path
Activity_log = "activity.log" # File path for CeSI logs
Admin_username = "admin" # Username of admin user
Admin_password = "admin" # Password of admin user
[[nodes]]
Name = "node1"
Environment = ""
Username = ""
Password = ""
Host = "172.16.16.75"
Port = "9001"
[[nodes]]
Name = "node2"
Environment = ""
Username = "admin"
Password = "btr2014"
Host = "172.16.8.12"
Port = "9001"
Cp ${CESI_SETUP_PATH} / defaults/cesi.service / etc/systemd/system/cesi.service
Vi / etc/systemd/system/cesi.service
[Unit]
Description=cesi
[Service]
Environment=
ExecStart=/root/cesi/venv/bin/python3 / root/cesi/cesi/run.py-- config-file / etc/cesi.conf.toml
ExecReload=/bin/kill-HUP $MAINPID
KillSignal=TERM
User=root
WorkingDirectory=/root/cesi
Restart=on-failure
[Install]
WantedBy=multi-user.target
Systemctl daemon-reload
Systemctl start cesi
Display figure:! [] (https://s1.51cto.com/images/blog/201903/05/398eda22207b54bd888ba09ebcfe03d3.png?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
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.