Nuxt.js: Starting Nuxt in PM2 Cluster Mode

Created on 10 Nov 2017  路  4Comments  路  Source: nuxt/nuxt.js

Hello,

Is it possible to set nuxt to start in cluster mode in pm2?

Something like: pm2 start nuxt start -i max

** Regarding that I am using a store to persist the session.

This question is available on Nuxt.js community (#c1843)
contributions welcome question

Most helpful comment

@rikez
nuxt-start is a command for starting script inside nuxt bin directory.
pm2 expects script as input (entrypoint).
You can use this command: pm2 start node_modules/nuxt/bin/nuxt-start -i max
It starts nuxt in cluster mode. Don't forget to run build before start.

All 4 comments

i use the koa template to build my project锛宼hen i can use pm2 to start build/main.js.
you can think about it.

@rikez
nuxt-start is a command for starting script inside nuxt bin directory.
pm2 expects script as input (entrypoint).
You can use this command: pm2 start node_modules/nuxt/bin/nuxt-start -i max
It starts nuxt in cluster mode. Don't forget to run build before start.

@manico
This way works for me.

But cannot assign port with --port

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shyamchandranmec picture shyamchandranmec  路  3Comments

vadimsg picture vadimsg  路  3Comments

danieloprado picture danieloprado  路  3Comments

uptownhr picture uptownhr  路  3Comments

lazycrazy picture lazycrazy  路  3Comments