我无法在DigitalOcean(CentOS7)上启动PM2
[PM2] Process config loading failed []
完整命令..
bash-4.3# pm2 start ecosystem.config.js --env production
[PM2][WARN] You are starting -1 processes in fork_mode without load balancing. To enable it remove -x option.
[PM2][WARN] Applications api not running, starting...
[PM2] Process config loading failed []
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬─────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ watching │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴─────┴──────────┘
Use `pm2 show <id|
我的生态系统是......
const nodeEnv = process.env.NODE_ENV || 'development';
if (nodeEnv === 'development') {
require('dotenv').config();
}
const maxMemory = process.env.WEB_MEMORY || 80;
const base = {
source_map_support: true,
node_args: [
'--optimize_for_size',
'--max_old_space_size=400',
'--gc_interval=100',
],
instances: process.env.WEB_CONCURRENCY || -1,
exec_mode: 'fork',
max_memory_restart: `${maxMemory}M`,
};
module.exports = {
apps: [
Object.assign({}, {
name: 'api',
script: 'api/index.js',
env: {
NODE_ENV: nodeEnv,
PORT: process.env.PORT || 3000,
API_MONGO_URL: process.env.API_MONGO_URL || 'mongodb://localhost',
JWT_SECRET: process.env.JWT_SECRET || 'AA',
SALT_WORK_FACTOR: process.env.SALT_WORK_FACTOR || 8,
},
env_production: {
NODE_ENV: "production",
API_MONGO_URL: `mongodb://${process.env.MONGODB_PORT_27017_TCP_ADDR}:${process.env.MONGODB_PORT_27017_TCP_PORT}/swarmbot`,
},
}, base),
],
};
日志上没有任何内容..
bash-4.3# pm2 logs
[TAILING] Tailing last 15 lines for [all] processes (change the value with --lines option)
/root/.pm2/pm2.log last 15 lines:
PM2 | 2017-06-22 02:45:54: ===============================================================================
PM2 | 2017-06-22 02:45:54: --- New PM2 Daemon started ----------------------------------------------------
PM2 | 2017-06-22 02:45:54: Time : Thu Jun 22 2017 02:45:54 GMT+0000 (UTC)
PM2 | 2017-06-22 02:45:54: PM2 version : 2.5.0
PM2 | 2017-06-22 02:45:54: Node.js version : 7.10.0
PM2 | 2017-06-22 02:45:54: Current arch : x64
PM2 | 2017-06-22 02:45:54: PM2 home : /root/.pm2
PM2 | 2017-06-22 02:45:54: PM2 PID file : /root/.pm2/pm2.pid
PM2 | 2017-06-22 02:45:54: RPC socket file : /root/.pm2/rpc.sock
PM2 | 2017-06-22 02:45:54: BUS socket file : /root/.pm2/pub.sock
PM2 | 2017-06-22 02:45:54: Application log path : /root/.pm2/logs
PM2 | 2017-06-22 02:45:54: Process dump file : /root/.pm2/dump.pm2
PM2 | 2017-06-22 02:45:54: Concurrent actions : 2
PM2 | 2017-06-22 02:45:54: SIGTERM timeout : 1600
PM2 | 2017-06-22 02:45:54: ===============================================================================
[STREAMING] Now streaming realtime logs for [all] processes