Clarification for `isCluster`
-
isCluster
Set this to true if you have multiple machines each running a single NodeBB process. This setting is not required if you have multiple NodeBB processes running either on a single or multiple machines.Now that I'm developing a Helm chart for NodeBB, I think this config confused me quite a bit. In Kubernetes we can use the Deployment resource to spawn multiple pod, that each runs an independent NodeBB process that could spawn in any node.
So, if I scale the NodeBB deployment to 3 replicas, does that mean I have multiple machines each running a single NodeBB process, or do I have multiple NodeBB processes running either on a single or multiple machines?
The locations of the replicas pods depend on the schedulers decision, meaning all of the replicas can stay on the same node, unless Pod Topology Spread Constraints or Node Affinity is enforced.
-
Basically the
isCluster
setting controls how multiple nodebbs will communicate with each other.If it is not set explicitly it is determined automatically from number of ports used. https://github.com/NodeBB/NodeBB/blob/master/loader.js#L108
So if you are only running a single nodebb process on each server but using multiple servers you need to manually set it to
true
so that the nodebbs use redis pubsub to communicate.https://github.com/NodeBB/NodeBB/blob/master/src/pubsub.js#L17-L49
If all the nodebb processes are one the same physical server they can just communicate through IPC, if cluster is set to true they will use redis
-