Build a cluster nodered

I want to create a nodered cluster,Is there a guide for how to build it?

Do you need a true cluster? Or can an active and standby instance be the solution? A true cluster implies you have explicit concurrency between the two nodes (or more) of the cluster. I setup two instances of node-red, they watch each other, and if the primary does dark, can't ping or does not response to HTTP GET of the UI page, the secondary spins up. Testing this now, I plan to create flows for this, right now just a simple script file. I don't need true shared storage, I keep separate copies of the flows on each instance. But you could, I think have a flows file shared across the nodes, as long as only one has read-write access at a time, to avoid deployment stomping.

I am sorry for reply so late to you.yes,I need a true cluster, I want to use node-red to compute a huge data,single node can't afford it.Could you provide some advise to solve it ?

That is a bit of an issue, a true cluster. Because NR is just not designed for that at its core. It is not aware of any type of online peer instance, if you get my meaning. So you will need to wrapper it with something that does to active/active or active/passive clustering logic. I am not a Node.js guru, so there may be a container model for node.js that can provide this 'cluster' logic. It will need to address that fact that NR can''t understand shared storage, be it in memory or otherwise.

I would say the best options are a virtual machine that has mirrored or instance fail-over. This means you really have just one local virtual machine, running NR, that it is highly available because the virtual machine is redundant, in total, inclusive of the OS, and the entire application layer, which is now classic virtualization works of course.

You might be able to run NR in a docker instance, that is also a floating instance, so that it survives a cluster node failure below its awareness, if you get my meaning.

The classic way to create a mimic of a cluster based application is to use some type of virtualization. If you are not familiar with virtualization, say VMware or KVM? Let me know I can give you more details on how such works.

I setup a active/passive NR environment... that does not survive a failure but does recover functionality. I have two devices running each NR. They ping each other, if one fails, the other continues. This is not transparent, because I have two instances. When one fails, I lose the data on that one instance, that is not on the other. But this is all I needed for what my flows do, because most of the flows drop data into a database. So if one instance fails, and other continues, a loss of some data is acceptable.

If I could not afford any data loss I would implement a virtual machine that is across to physical hypervisors, classic virtualization instance mirroring. As I outlined above.