最終更新:2023-11-10 (金) 09:05:34 (188d)  

PM2
Top / PM2

Advanced, production process manager for Node.js

http://pm2.keymetrics.io/

コマンド

使い方

  • --watchをつけるとスクリプトの変更を検知してくれる

メモ

  • pm2 stop?
  • pm2 restart?
  • pm2 delete?

パラメータ

  • # Specify an app name
    --name <app_name>
    
    # Watch and Restart app when files change
    --watch
    
    # Set memory threshold for app reload
    --max-memory-restart <200MB>
    
    # Specify log file
    --log <log_path>
    
    # Pass extra arguments to the script
    -- arg1 arg2 arg3
    
    # Delay between automatic restarts
    --restart-delay <delay in ms>
    
    # Prefix logs with time
    --time
    
    # Do not auto restart app
    --no-autorestart
    
    # Specify cron for forced restart
    --cron <cron_pattern>
    
    # Attach to application log
    --no-daemon

インストール

  • npm install -g pm2
  • グローバルに入れないとパスが通らない

設定ファイル

  • ecosystem.config.js?