C/C++教程

CentOS7.x 配置 supervisor 开机启动微服务

本文主要是介绍CentOS7.x 配置 supervisor 开机启动微服务,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1. mysql的配置文件:

  [program:mysql]
  command=/usr/local/tools/mysql/bin/mysqld --basedir=/usr/local/tools/mysql --datadir=/usr/local/tools/data/mysql --plugin-dir=/usr/local/tools/mysql/lib/plugin --  user=mysql --log-error=/var/log/mysqld.log --pid-file=/usr/local/tools/data/mysql/JD.jcloud.local.pid --socket=/usr/local/tools/data/mysql/mysql.sock
  autostart=true
  startretries=3
  autorestart=true
  user=root
  redirect_stderr=true
  stderr_logfile=/home/supervisor/log/mysql.err.log
  stdout_logfile=/home/supervisor/log/mysql.out.log

2. nginx的配置文件:

  [program:nginx]
  command=nginx -g 'daemon off;'
  user=root
  autostart=true
  autorestart=true
  startsecs=3
  redirect_stderr=true
  stderr_logfile=/home/supervisor/log/nginx.err.log
  stdout_logfile=/home/supervisor/log/nginx.out.log

3. redis的配置文件:

  [program:redisd]
  command=/usr/local/redis/bin/redis-server
  autostart=true
  startretries=3
  autorestart=true
  user=root
  redirect_stderr=true
  stderr_logfile=/home/supervisor/log/redis.err.log
  stdout_logfile=/home/supervisor/log/redis.out.log

这篇关于CentOS7.x 配置 supervisor 开机启动微服务的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!