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

  • 相关阅读:
    Mysql常见索引介绍
    Mysql字段修饰符(约束)
    使用select和show命令查看mysql数据库系统信息
    Mysql5.7数据库介绍
    对Mysql数据表本身进行操作
    各种修改Mysql字符集
    Mysql的安全配置向导命令mysql_secure_installation
    firewalld介绍
    CentOS7使用yum安装mysql5.7
    利用ASP.NET一般处理程序动态生成Web图像(转)
  • 原文地址:https://www.cnblogs.com/qczxz/p/8776830.html
Copyright © 2011-2022 走看看