系统相关
首页 > 系统相关> > linux 上使用pm2启动nodejs服务

linux 上使用pm2启动nodejs服务

作者:互联网

1.安装pm2: 

npm install -g pm2

2.在启动文件夹内新建文件processes.json:

{   "apps": [     {       "name": "schedulingBack",       "cwd": "/root/zdy/project/schedulingBack",       "script": "bin/www",       "log_date_format": "YYYY-MM-DD HH:mm Z",       "error_file": "/root/zdy/log/node-app.stderr.log",       "out_file": "log/node-app.stdout.log",       "pid_file": "pids/node-geo-api.pid",       "instances": 6,       "min_uptime": "200s",       "max_restarts": 10,       "max_memory_restart": "1024M",       "cron_restart": "1 1 1 * *",       "watch": false,       "merge_logs": true,       "exec_interpreter": "node",       "exec_mode": "fork",       "autorestart": false,       "vizion": false     }   ] }  

参考:https://www.jianshu.com/p/d2a640b8661c

标签:log,pm2,nodejs,max,应用程序,file,linux,restart
来源: https://www.cnblogs.com/jack123/p/15801010.html