【问题标题】:How to PM2 start more than one processes artisan laravel in one directory?PM2 如何在一个目录中启动多个进程 artisan laravel?
【发布时间】:2021-09-22 20:21:51
【问题描述】:

我正在使用 pm2 来使用后台进程,我只是有一些问题,我的系统需要 2 个后台进程但在不同的工匠命令中,所以我正在使用以下步骤:

# install
npm install -g pm2

# in project dir with your CI or dev setup tool 
# --name gives task a name so that you can later manage it
# -- delimits arguments that get passed to the script
pm2 start artisan --interpreter php --name queue-worker -- queue:work --daemon
pm2 start artisan --interpreter php --name schedule-worker -- schedule:work --daemon

但是在执行该步骤时,我的第一个(队列工作人员)进程被替换为第二个命令(调度工作人员)。你们能给我一个命令 pm2 可以在一个目录中使用多个进程背景吗?

【问题讨论】:

    标签: laravel background-process pm2


    【解决方案1】:

    解决方法是在您运行进程的系统上创建另一个用户(除了管理员),并在那里启动一个新的 pm2 进程,这可能对您有用。

    虽然,我确实认为这不是正确的做法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-04
      • 1970-01-01
      相关资源
      最近更新 更多