Look at the tutorial installation elk, found Supervisord this simple and easy to use process management tools, he supports the web and text two ways, let's say a specific usage. More detailed configuration file description You can baidu by yourself.
#安装
# yum-y Install Python-setuptools #安装easy_install package for this command # Easy_install supervisor #安装supervisor
#生成配置文件
# echo_supervisord_conf >/etc/supervisord.conf
#启动
# Supervisord #也可以 [-C + profile path] Specify config file # supervisorctl reload #修改了配置文件需要此操作重载, restart Supervi Sord's Services
#关闭
[[Email protected] ~]$ PS aux | grep supervroot 1203 0.0 0.7 200748 7156? Ss 09:15 0:03/usr/bin/python/usr/bin/supervisord-c/etc/supervisord.conftomcat 2147 0.0 0.0 103248 864 pts/ 0 s+ 11:03 0:00 grep superv[[email protected] ~]$ sudo kill-9 1203
#配置文件说明, this English note has a description.
[unix_http_server]file=/tmp/supervisor.sock ; Specifies the location of the socket file, which is required when there is no such file; chmod=0700 ; Start supervisord and execute supervisorctl;chown=nobody:nogroup ; ;username=user ; ;p assword=123 ; [inet_http_server] ; Open the Web management function, the default is closed, should also be closed port=192.168.182.131:9001 ; should also be closed, otherwise unsafe, here we to demonstrate username= user ; Turn on this feature first password=123 ; [supervisord] ; This is mainly to define some parameters of the Supervisord server side, you must set the location of the Logfile=/tmp/supervisord.log ; supervisord log file, If the log is not set at the current location logfile_maxbytes=50mb ; A new log file is generated when logs exceed 50M. When restricted to 0 ; does not limit the size of the file logfile_backups=10 ; the number of log files kept, Supervisor automatically creates 10 when you start the program ; backup file for Logrotate, when set to 0, indicates no limit &nbNumber of sp; ; files loglevel=info ; log level, default info, non-mandatory set pidfile=/tmp/supervisord.pid ; nodaemon=false ; minfds=1024 ; This is the least system free file descriptor, below this value Supervisord will not ; will start. /proc/sys/fs/file-max view, default 1024, non-must set minprocs=200 ; minimum available process descriptor, below this value supervisor will not start. ; ulimit -u can be viewed, without modification by default [program:elasticsearch] ; Add Elasticsearch service command = /home/tomcat/ elasticsearch/bin/elasticsearch ; the initiator path can be autostart = truestartsecs = 5autorestart with parameters = truestartretries = 3 ; the other is not written, the configuration file is also explained in English user = tomcat ; which user to start redirect_stderr = truestdout_logfile_maxbytes = 20mbstdout_logfile_backups = 20stdout_logfile = / home/tomcat/logs/elasticsearch_super.log[program:logstash]directory = /home/tomcat/logstash/bin/ command = /home/tomcat/logstash/bin/logstash -f /home/tomcat/testlog.confautostart = truestartsecs = 5autorestarT = truestartretries = 3user = tomcatredirect_stderr = truestdout_ logfile_maxbytes = 20mbstdout_logfile_backups = 20stdout_logfile = /home/tomcat/ Logs/logstash_super.log[program:kibana]directory = /home/tomcat/kibana/bin/command = /home /tomcat/kibana/bin/kibanaautostart = truestartsecs = 5autorestart = truestartretries = 3user = tomcat redirect_stderr = truestdout_logfile_maxbytes = 20mbstdout_logfile_backups = 20stdout_logfile = /home/tomcat/logs/kibana_super.log[group:elk] ; Group Management is very convenient, we can start|stop|statusprograms=elasticsearch,logstash,kibana ; elk:* to start or close all services for this group, it must not be turned on. [Include] ; when we have to manage a lot of processes , written in a file, files = /etc/supervisor/*.conf ; a bit too big. The configuration file can be written to multiple files at this time ; then include.
#supervisord有两种执行命令的方式, you can direct the command line:
[email protected] ~]$ sudo supervisorctl statuselk:elasticsearch RUNNING pid 1430, uptime 0:48:51elk:kib Ana RUNNING pid 1432, uptime 0:48:51elk:logstash RUNNING PID 1431, uptime 0: 48:51
#也可以进入子shell (Ctrl + C exit child shell):
[[email protected] ~]$ sudo supervisorctlelk:elasticsearch running pid 1430, uptime 0:51:57elk:kibana running pid 1432, uptime 0:51:57elk:logstash running pid 1431, uptime 0:51:57supervisor> stop elk:*elk:kibana: stoppedelk:elasticsearch: stoppedelk: logstash: stoppedsupervisor> statuselk:elasticsearch STOPPED Nov 30 10:29 Amelk:kibana stopped nov 30 10:29 amelk:logstash STOPPED Nov 30 10:29 am
#最后看看web界面吧 (not feeling safe or cautious)
#浏览器输入http://ip:port
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/8A/DF/wKioL1g-PMbDm8uFAAA_Awdv0TA730.png "title=" Supervisor1.png "alt=" Wkiol1g-pmbdm8ufaaa_awdv0ta730.png "/>
#然后就可以管理你的服务进程了
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/8A/E3/wKiom1g-PP3i81upAADWGHEZKag341.png "title=" Supervisord.png "alt=" Wkiom1g-pp3i81upaadwghezkag341.png "/>
This article is from the "Breeze" blog, be sure to keep this source http://358778493.blog.51cto.com/11386071/1878051
Managing Elk processes with Supervisord