• supervisor管理ELK进程


    1、配置supervisor

    #更新epel
    yum install epel-release     
    yum install python-pip
    pip install supervisor
    mkdir -m 755 -p /etc/supervisor/conf.d/
    cd /etc/supervisor/conf.d/
    #生成supervisor配置文件
    echo_supervisord_conf > /etc/supervisor/supervisord.conf  
    #编辑supervisor配置文件
    vim /etc/supervisor/supervisord.conf
      [include]
      files = /etc/supervisor/conf.d/*.ini

    2、编辑elasticsearch.ini文件

    vim /etc/supervisor/conf.d/elasticsearch.ini
    
    [program:elasticsearch]
    command=/usr/local/elasticsearch-6.2.3/bin/elasticsearch #启动程序的命令
    directory=/usr/local/elasticsearch-6.2.3    # 程序文件夹
    user=elk    # 指定用户 
    numprocs=1    
    priority=1 # 优先级 默认:999,数值越小优先级越高 
    autostart=true    # 是否随supervisor启动而自动启动 
    ;startsecs=10    # 启动正常运行多久,则为启动成功。默认为:1秒 
    satrtretries=3    # 启动失败重试次数 
    autorestart=true    # 进程挂掉,是否重启 
    stopasgroup=true    # 默认为false,进程被杀死时,是否向这个进程组发送stop信号,包括子进程 
    killasgroup=true    # 默认为false,向进程组发送kill信号,包括子进程 
    redirect_stderr=true    # std_error日志重定向到std_out 
    stdout_logfile_maxbytes=50MB    # 日志最大大小 
    stdout_logfile_backups=10    # 日志最多保留数量 
    stdout_logfile=/var/log/supervisor/supervisor_elasticsearch.log    # 日志路径

    #配置的时候复制粘贴下面的文本:

    [program:elasticsearch]
    command=/usr/local/elasticsearch-6.2.3/bin/elasticsearch
    directory=/usr/local/elasticsearch-6.2.3
    user=elk
    numprocs=1
    priority=1
    autostart=true
    ;startsecs=10
    satrtretries=3
    autorestart=true
    stopasgroup=true
    killasgroup=true
    redirect_stderr=true
    stdout_logfile_maxbytes=50MB
    stdout_logfile_backups=10
    stdout_logfile=/var/log/supervisor/supervisor_elasticsearch.log

    3、编辑kibana.ini文件

    vim /etc/supervisor/conf.d/kibana.ini 
    
    [program:kibana] 
    directory=/usr/local/kibana-6.2.3 
    command=/usr/local/kibana-6.2.3/bin/kibana 
    numprocs=1 
    priority=3 
    autostart=true 
    ;startsecs=10 
    startretries=3 
    autorestart=true 
    redirect_stderr=true 
    tdout_logfile_maxbytes=50MB 
    stdout_logfile_backups=10 
    stdout_logfile=/var/log/supervisor/supervisor_kibana.log

     4、编辑logstash.ini文件

    vim /etc/comf.d/supervisor/logstash.ini 
    [program:logstash] 
    directory=/usr/local/logstash-6.2.3 
    command=/usr/local/logstash-6.2.3/bin/logstash -f /usr/local/logstash-6.2.3/config/logstash.conf
    numprocs=1 
    priority=2 
    autostart=true 
    ;startsecs=5 
    startretries=3 
    autorestart=true 
    stopasgroup=true 
    killasgroup=true 
    redirect_stderr=true stdout_logfile_maxbytes=50MB 
    stdout_logfile_backups =10 
    stdout_logfile=/var/log/supervisor/supervisor_logstash.log

     4、启动supervisor

    [root@localhost conf.d]# supervisord -c /etc/supervisor/supervisord.conf 
    [root@localhost conf.d]# supervisorctl status
    elasticsearch                    RUNNING   pid 102596, uptime 0:01:39
    kibana                           RUNNING   pid 103038, uptime 0:00:02
  • 相关阅读:
    [转帖]活用Quartus II内置模板,快速输入HDL代码、TimeQuset束缚及tcl语句等
    [笔记] FPGA的发展
    [转帖]状态机的编码
    [笔记]Altera中DDR3设计
    [笔记]Test Plan的编写 及 程序开头注释
    [HDOJ2457]DNA repair
    [HDOJ2355]The Sidewinder Sleeps Tonite
    [HDOJ2825]Wireless Password
    [HDOJ2222]Keywords Search
    [HDOJ2454]Degree Sequence of Graph G
  • 原文地址:https://www.cnblogs.com/pythonal/p/10148647.html
Copyright © 2020-2023  润新知