安装

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. PAT 乙级 1019.数字黑洞 C++/Java

    题目来源 给定任一个各位数字不完全相同的 4 位正整数,如果我们先把 4 个数字按非递增排序,再按非递减排序,然后用第 1 个数字减第 2 个数字,将得到一个新的数字.一直重复这样做,我们很快会停在有 ...

  2. hexo的jacman主题设置语言为英文后偶尔出现中文

    发现这个问题也好久了.问题的具体表现是在根目录下的_config.yml设置了语言为英文,但是每次发布后都会更换一次语言.今天看了文件结构,知道了,每换一次语言“英文.简体中文.繁体中文”,就是这三种 ...

  3. 用BlockBoundQueue和c++11实现多线程生产者消费者问题

    // file : blockBoundQueue.h #ifndef YANG_BLOCKBOUNDQUEUE #define YANG_BLOCKBOUNDQUEUE #include <m ...

  4. c++、oc、swift初步评价

    c++是面向对象的多态语言: oc是面向对象的动态语言: swift是面向对象.面向协议.高阶类型.函数式编程语言:

  5. 解决node.js链接数据库时出现的报错 --- client does not support authentication

    打开mysql数据库小黑屏 然后输入 mysql> alter user 'root'@'localhost' identified with mysql_native_password by ...

  6. 51nod1814 Clarke and string

    [传送门] 直接想最暴力的做法就是正解了.每次询问都把两个串的回文树建出来,然后再两棵树上同时dfs,经过相同的节点答案就加一.遇到一个不存在的就退出.再把询问记忆化一下就OK了.复杂度是 $O(n ...

  7. es6 -- rest 参数

    es6 引入了rest参数(形式:...变量名),用于获取函数的多余参数,这样就不需要使用arguments对象了.rest参数搭配的变量是一个数组,该变量将多余的参数放入数组中. function ...

  8. Linked List Sorting

    静态链表(用结构体数组模拟链表)     1052 Linked List Sorting (25分)   A linked list consists of a series of structur ...

  9. 68-Flutter中极光推送的使用

    1.申请极光账号和建立应用 极光推送的官方网址为:https://www.jiguang.cn/ 注册好后,进入'服务中心',然后再进入'开发者平台',点击创建应用. 这时候会出现新页面,让你填写“应 ...

  10. LeetCode 848. Shifting Letters

    原题链接在这里:https://leetcode.com/problems/shifting-letters/ 题目: We have a string S of lowercase letters, ...