SUPERVIOSRD Process Management

Source: Internet
Author: User
Tags zookeeper

Supervisor Process Manager
---------------------------
1. Installation dependencies
Yum Install Python-setuptools-devel

2. Installing Supervisor
Pip Install supervisor or Easy_install Supervisor

3. Build the configuration file
echo_supervisord_conf >/etc/supervisord.conf
Modify
[Unix_http_server]
File=/var/run/supervisor.sock
[Supervisord]
Logfile=/var/log/supervisord.log
Pidfile=/var/run/supervisord.pid
[Supervisorctl]
Serverurl=unix:///var/run/supervisor.sock
[include]
Files =/etc/supervisord.d/*.conf

4. Supervisord service startup script
#!/bin/sh
#
#/etc/init.d/supervisord
#
# Supervisor is a client/server system That
# allows their users to monitor and control a
# number of processes on unix-like operating
# systems.
#
# chkconfig:-+
# description:supervisor Server
# processname:supervisord

# Source init function S
./etc/rc.d/init.d/functions

prog= "Supervisord"

prefix= "/usr/local"
exec_prefix= "${prefix } "
prog_bin=" ${exec_prefix}/bin/supervisord "
pidfile="/var/run/$prog. pid "


Start ()
{
Echo-n $ "Starting $prog:"
# # #注意下面这一行一定得有-C/etc/supervisord.conf Otherwise the configuration file has not been modified at all!
Daemon $prog _bin-c/etc/supervisord.conf--pidfile $PIDFILE
Sleep 1
[-F $PIDFILE] && success $ "$PR og Startup "| | Failure $ "$prog startup"
Echo
}

Stop ()
{
If [-f $PIDFILE]
then
Echo-n $ ' shutting down $PR OG: "
[-F $PIDFILE] && Killproc $prog | | Success $ "$prog shutdown"
Echo
Else
Echo-n "$prog is not running"
Echo
Fi
}

Case "$" in
Start)
start
;;

Stop)
stop
;;

Status
Status $prog
;;

Restart)
Stop
start
;;

*)
Echo "Usage: $ {start|stop|restart|status}"
;;

Esac

5. Management Service Profile Example
#cat/etc/supervisord.d/kafka.conf
[Program:zookeeper]
Command=/data/elk/kafka/bin/zookeeper-server-start.sh/data/elk/kafka/config/zookeeper.properties
Autostart = True
Startsecs = 5
#user = root
Redirect_stderr = True
Stdout_logfile =/var/log/supervisord/zookeeper.log

[Program:kafka]
Command=/data/elk/kafka/bin/kafka-server-start.sh/data/elk/kafka/config/server.properties
Autostart = True
Startsecs = 5
#user = root
Redirect_stderr = True
Stdout_logfile =/var/log/supervisord/kafka.log

6. Supervisord Command-line administration tool
Supervisorctl Start Program
Supervisorctl Stop Program
Supervisorctl Restart Program
Supervisorctl Restart all
Supervisorctl status
Supervisorctl Reload


Bootstrap.system_call_filter:false
network.host:0.0.0.0
Discovery.zen.ping.unicast.hosts: ["127.0.0.1", "192.168.50.224"]
Node.max_local_storage_nodes:2

SUPERVIOSRD Process Management

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.