PM2 ignoring ecosystem file

Viewed 424

I have the following file

ecosystem.js:

module.exports = {
    apps: [
        {
            name: 'my-app',
            cwd: '/test,
            script: './myapp.js',
            instances: 'max', // match the number of CPUs on the machine
            exec_mode: 'cluster', // Run multiple child processes
            args: 'start',
            env: {
                NODE_ENV: 'production'
            }
        },
    ],
};

I expect to see a cluster of node processes running. But it seems to start it in fork mode, ignoring my settings entirely.

I start like this:

pm2 start ecosystem.js

Output:

Starting ecosystem.js in fork_mode (1 instance)
─────────┐
│ id  │ name                    │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼─────────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0   │ ecosystem    │ default     │ 1.0.0   │ fork    │ 156879   │ 0s     │ 0    │ online    │ 0%       │ 14.3mb   │ -… │ disabled │
└─────┴─────────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘

What could be causing this?

1 Answers
Related