You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to start parse server in a cluster of 3 instances (4 cores, so N - 1)
Setting the "cluster" parameter when creating new ParseServer() is not working
I tried with an app using [email protected] and with a clean installation of parse-server-example using latest parse-server without success;
Setting the "cluster" parameter when creating new ParseServer() is not working
I've tried with parse-server CLI and the clustering is working properly
This is expected and it may be more obvious when you think about it this way:
Starting Parse Server via the CLI parse-server --cluster=true ... does not immediately create and start a Node.js Parse Server instance. It is merely telling the Parse CLI that you want to launch a Parse Server instance. The CLI acts as an intermediary and looks at the cluster option to launch multiple Parse Server instances.
Starting Parse Server via Node.js const api = new ParseServer(...); express().use('/parse', api); means you are directly creating and launching a Parse Server instance. There is no intermediary who looks at the cluster option. So it would be up to you to launch multiple Parse Server instances using the Node.js cluster package which provides an example.
@mtrezza@TomWFox Just to clarify - the conclusion here was that using the cluster option has no effect when using new ParseServer(...)?
Could that be updated somewhere in the docs? The ParseServerOptions docs mention the cluster option in a way that certainly implies that it does something when used with new ParseServer(), but attempting to understand its impact is what led me here.
You are correct. The cluster option is in the Parse Server Options docs because usually (probably all other) options can be set either via the Parse Server CLI or via the Parse Server object. cluster is an exception and can only be set via the CLI, as it needs the CLI intermediary logic to spin up multiple Parse Server instances.
Please feel free to add a comment to the options definitions. We do not have a way in the docs to specify "CLI only" options, so a comment there should be fine. The change would be made in this parse-server repo in the options definitions. Remember to run npm run definitions and npm run docs afterwards. You can reference this issue in your PR.
Activity
mtrezza commentedon Sep 3, 2020
This is expected and it may be more obvious when you think about it this way:
Starting Parse Server via the CLI
parse-server --cluster=true ...does not immediately create and start a Node.js Parse Server instance. It is merely telling the Parse CLI that you want to launch a Parse Server instance. The CLI acts as an intermediary and looks at theclusteroption to launch multiple Parse Server instances.Starting Parse Server via Node.js
const api = new ParseServer(...); express().use('/parse', api);means you are directly creating and launching a Parse Server instance. There is no intermediary who looks at theclusteroption. So it would be up to you to launch multiple Parse Server instances using the Node.js cluster package which provides an example.@dplewis Just to make sure, did I get this right?
TomWFox commentedon Sep 12, 2020
I'm closing this as there has been no further response, let us know if you still have any questions/issues.
rdhelms commentedon Jul 23, 2021
@mtrezza @TomWFox Just to clarify - the conclusion here was that using the
clusteroption has no effect when usingnew ParseServer(...)?Could that be updated somewhere in the docs? The ParseServerOptions docs mention the
clusteroption in a way that certainly implies that it does something when used withnew ParseServer(), but attempting to understand its impact is what led me here.mtrezza commentedon Jul 23, 2021
Such a note would be welcome.
You are correct. The
clusteroption is in the Parse Server Options docs because usually (probably all other) options can be set either via the Parse Server CLI or via the Parse Server object.clusteris an exception and can only be set via the CLI, as it needs the CLI intermediary logic to spin up multiple Parse Server instances.Please feel free to add a comment to the options definitions. We do not have a way in the docs to specify "CLI only" options, so a comment there should be fine. The change would be made in this parse-server repo in the options definitions. Remember to run
npm run definitionsandnpm run docsafterwards. You can reference this issue in your PR.