zoukankan      html  css  js  c++  java
  • Supervisor安装、配置、开启启动

    1、安装Python包管理工具(easy_install)
      wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py -O - | sudo python

    2、安装supervisor
      easy_install supervisor

    2.1、查看版本,检验是否安装成功
      supervisord -v

    3、配置
    3.1、生成supervisor的初始化配置文件
      echo_supervisord_conf > /etc/supervisord.conf

    3.2、编辑supervisord.conf
      vim /etc/supervisord.conf

    3.3、配置启动内容
      [program:mobileyingfeng]
      command=/usr/bin/java -Djava.security.egd=file:/dev/./urandom -Dserver.port=85 -Dspring.profiles.active=prod -Dspring.datasource.password=2S323uHHH -Dspring.redis.password=K6EnRBjLa -jar /root/yingfeng/mobileyingfeng.jar
      user=root
      stderr_logfile = /root/yingfeng/logs/mobile-yingfeng-error.log
      stdout_logfile = /root/yingfeng/logs/mobile-yingfeng.log
      directory=/
    3.4、在下图位置添加添加上面的内容
      

    3.5、手动启动:
      supervisord -c /etc/supervisord.conf

    3.6、相关命令:
      supervisorctl update 重新加载配置
      supervisorctl reload 重新启动所有程序
      supervisorctl status 查看状态

    4、开机启动
      vim /usr/lib/systemd/system/supervisord.service

    4.1、supervisord.service文件内容:

      # dservice for systemd (CentOS 7.0+)
      # by ET-CS (https://github.com/ET-CS)
      [Unit]
      Description=Supervisor daemon
      [Service]
      Type=forking
      ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
      ExecStop=/usr/bin/supervisorctl shutdown
      ExecReload=/usr/bin/supervisorctl reload
      KillMode=process
      Restart=on-failure
      RestartSec=42s
      [Install]
      WantedBy=multi-user.target

    4.2、设为开机启动
      systemctl enable supervisord

    4.3、验证一下是否为开机启动
      systemctl is-enabled supervisord

  • 相关阅读:
    #背包方案 ——整数划分(Acwing900)
    #分组背包 #背包方案 ——Acwing 1013 机器分配
    #背包 #二进制优化 ——Acwing 5. 多重背包问题 II(二进制优化)
    #背包方案 AcWing 532. 货币系统
    #背包方案 ——AcWing 1021. 货币系统2
    背包问题求方案数
    有依赖的背包问题
    分组背包问题
    二维费用的背包问题
    混合背包问题
  • 原文地址:https://www.cnblogs.com/qczxz/p/8776830.html
Copyright © 2011-2022 走看看