安装

sudo apt-get install supervisor

启动,否则会报 unix:///tmp/supervisor.sock no such file

service supervisor start

或者

supervisord -c /etc/supervisor/supervisord.conf

生成配置文件

echo_supervisord_conf > /etc/supervisor/supervisord.conf

注意里面的注释去掉

[inet_http_server]         ; inet (TCP) server disabled by default
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
username=user ; (default is no username (open server))
password=123 ; (default is no password (open server))

配置文件路径

[include]
files = /etc/supervisor/conf.d/*.conf

查看状态

supervisorctl status #查看supervisorctl状态
supervisorctl start openfalcon #启动子进程
supervisorctl stop openfalcon #关闭子进程
supervisorctl restart openfalcon #重启子进程

比如

lintong@master:~$ supervisorctl status
openfalcon RUNNING pid 10759, uptime 0:18:46

配置文件在 /etc/supervisor 目录下

lintong@master:/etc/supervisor$ ls
conf.d start_openfalcon.conf supervisord.conf

内容

[program:openfalcon]
command = cd ~/software/open-falcon-v0.2.1 & open-falcon start
user = lintong
autostart = true
autoresart = true
stderr_logfile = /var/log/supervisor/openfalcon.stderr.log
stdout_logfile = /var/log/supervisor/openfalcon.stdout.log

重新加载配置

supervisorctl reload

更新配置

supervisorctl update

web界面,账号密码参考 /etc/supervisord.conf

localhost:9001

下面是几个例子

lintong@lintong-B250M-DS3H:/etc/supervisor/conf.d$ ls
es.conf hadoop.conf hive.conf redis.conf

hadoop

[program:hadoop]
directory=/home/lintong/software/apache/hadoop-2.9.1
command = bash ./sbin/start-all.sh
user = lintong
autostart = true
autoresart = false
stderr_logfile = /var/log/supervisor/hadoop.stderr.log
stdout_logfile = /var/log/supervisor/hadoop.stdout.log

hive

[program:hive]
directory=/home/lintong/software/apache/apache-hive-2.3.3-bin
command = bash ./bin/hiveserver2 start
user = lintong
autostart = true
autoresart = true
stderr_logfile = /var/log/supervisor/hive.stderr.log
stdout_logfile = /var/log/supervisor/hive.stdout.log

es

[program:es]
directory=/home/lintong/software/apache/elasticsearch-6.2.4
command = bash ./bin/elasticsearch
user = lintong
autostart = true
autoresart = true
stderr_logfile = /var/log/supervisor/es.stderr.log
stdout_logfile = /var/log/supervisor/es.stdout.log

kafka_manager

其中的/bin/bash -c 'source "$0" && exec "$@"'是为了解决cant find command问题

[program:kafka-manager]
directory=/home/lintong/software/apache/kafka-manager-1.3.3.17/bin
command = /bin/bash -c 'source "$0" && exec "$@"' kafka-manager -Dconfig.file=/home/lintong/software/apache/kafka-manager-1.3.3.17/conf/application.conf -Dhttp.port=7778
user = lintong
autostart = true
autoresart = false
stderr_logfile = /var/log/supervisor/kafka_manager.stderr.log
stdout_logfile = /var/log/supervisor/kafka_manager.stdout.log

kibana

[program:kibana]
directory=/home/lintong/software/apache/kibana-6.2.4-linux-x86_64
command = bash ./bin/kibana
user = lintong
autostart = false
autoresart = true
stderr_logfile = /var/log/supervisor/kibana.stderr.log
stdout_logfile = /var/log/supervisor/kibana.stdout.log

zkui

[program:zkui]
directory=/home/lintong/software/zkui/target
command = java -jar zkui-2.0-SNAPSHOT-jar-with-dependencies.jar
user = lintong
autostart = false
autorestart = true
stderr_logfile = /var/log/supervisor/zkui.stderr.log
stdout_logfile = /var/log/supervisor/zkui.stdout.log

kafka-manager

[program:kafka-manager]
directory=/home/lintong/software/kafka-manager-1.3.3.17
command = bash ./bin/kafka-manager -Dconfig.file=/home/lintong/software/kafka-manager-1.3.3.17/conf/application.conf -Dhttp.port=7778
user = lintong
autostart = false
autorestart = true
stderr_logfile = /var/log/supervisor/kafka-manager.stderr.log
stdout_logfile = /var/log/supervisor/kafka-manager.stdout.log

Ubuntu16.04安装Supervisor的更多相关文章

  1. ubuntu16.04安装jdk,tomcat

    ubuntu16.04安装jdk,tomcat 最近装了一下tomcat,网上的教程很多,我也试了很多次,但是有一些教程关于tomcat配置是错误的,让我走上了歧途.差点重装系统,还好王总及时出手帮助 ...

  2. Ubuntu16.04 安装openjdk-7-jdk

    Ubuntu16.04 安装openjdk-7-jdk sudo apt-get install openjdk-7-jre 或者sudo apt-get install openjdk-7-jdk ...

  3. Ubuntu16.04安装GTK3主题:OSX-Arc

    Ubuntu16.04安装GTK3主题:OSX-Arc GTK3主题:OSX-Arc描述: 前几个月,Gnome3.20升3.22的时候,出现了大量主题崩溃的现象,其中包括Arc.Flatabulou ...

  4. Ubuntu16.04安装opencv for python/c++

    Ubuntu16.04安装opencv for python/c++ 网上关于opencv的安装已经有了不少资料,但是没有一篇资料能让我一次性安装成功,因此花费了大量时间去解决各种意外,希望这篇能给一 ...

  5. ubuntu16.04安装不上有道词典的解决办法

    转自:http://www.linuxdiyf.com/linux/21143.html ubuntu16.04安装不上有道词典,提示: le@hu-pc:~/下载$ sudo dpkg -i you ...

  6. Ubuntu16.04安装mongodb

    Ubuntu16.04安装mongodb copy from: http://blog.csdn.net/zhushh/article/details/52451441 1.导入软件源的公钥 sudo ...

  7. 【Tools】ubuntu16.04安装搜狗输入法

    Ubuntu16,04 安装搜狗输入法 1.下载搜狗输入法的安装包 下载地址为:http://pinyin.sogou.com/linux/ 2.按键Ctr+Alt+T打开终端,输入以下命令切换到下载 ...

  8. Ubuntu16.04安装cuda9.0+cudnn7.0

    Ubuntu16.04安装cuda9.0+cudnn7.0 这篇记录拖了好久,估计是去年6月份就已经安装过几遍,然后一方面因为俺比较懒,一方面后面没有经常在自己电脑上跑算法,比较少装cuda和cudn ...

  9. Ubuntu16.04安装TensorFlow及Mnist训练

    版权声明:本文为博主原创文章,欢迎转载,并请注明出处.联系方式:460356155@qq.com TensorFlow是Google开发的开源的深度学习框架,也是当前使用最广泛的深度学习框架. 一.安 ...

随机推荐

  1. Spring5.0.x SSM项目中Json转换器 的配置

    json作为前后端交互的重要手段,在springMVC中有自带的转换器可以免去平时那些繁琐的事情: pom文件添加:spring5.0以上用Jackson2.9以上的版本 <dependency ...

  2. mklink 文件夹链接 windows系统

    MS文档 https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink 命令参数 mkl ...

  3. rsa 解密过程

    直接扣js代码 $w = {}; if (typeof $w.RSAUtils === 'undefined') var RSAUtils = $w.RSAUtils = {}; var biRadi ...

  4. MVC开发中自定义返回类型

    在做项目web的MVC中,会用到返回值的问题,我们一般使用AjaxResult的返回值,根据自己的需要进行自定义,如下参考: using System; using System.Collection ...

  5. 关于__int 128 的读入与输出

    inline __int128 read() { ,w=; ; while(!isdigit(ch)) {w|=ch=='-';ch=getchar();} )+(X<<)+(ch^),c ...

  6. 实验十四+杜娣+团队项目评审&课程学习总结

    项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/p/11093584.html 这个作业的要求在哪里 https://www.cnblogs.c ...

  7. php解析xml的几种方式

    php提供几种解析xml的类或方法,包括:Xml parser. SimpleXML,.XMLReader,.DOMDocument. XML Expat Parser: XML Parser使用Ex ...

  8. 浏览器绘图模型的解释:renderObject、renderlayer

    先来看这幅经典的图: https://juejin.im/entry/590801780ce46300617c89b8 renderObject相当于iOS 的view renderlayer完成了一 ...

  9. cc2530单片机的第一次实验,流水灯

    第一个实验:控制流水灯 P1_0,P1_1,P0_4都连接在发光二极管的负极,所以,当这三个引脚为低电平,也就是0的时候,相应的发光二极管才会亮. 其实这里可以稍微的关注一下寄存器的地址,然后,编程的 ...

  10. leetcode 数据库练习 - 1205 每月交易I和II

    每月交易(一) Table: Transactions +---------------+---------+| Column Name | Type |+---------------+------ ...