How to scale Node-RED horizontally through a cluster of nodes?

Is it possible to scale Node-RED horizontally on a cluster of nodes? Could not find documentation. My scenario is to process millions of events per second and process them in real time using Node-RED.

+4
source share
1 answer

I posted a question on the Google Groups Node -RED forum ( https://groups.google.com/forum/#!topic/node-red/Nx1WWqBeLbI ) and received interesting answers. Breaking different options below.

If your entry exceeds HTTP, you can use any of the standard load balancing methods to load balance requests across a cluster of nodes working with the same Node-RED stream. You can use HAProxy, Nginx, etc. It is important to note that since we are launching the same thread across multiple nodes, we cannot store any state in context variables. We must store the state in an external service such as Redis.

If you swallow MQTT, we have several options: Option A . Let each thread listen on a different topic. You can publish different gateways on different topics in the MQTT broker - for example, Stream 1 instance subscribes to device / a / # Node -RED instance 2 subscribes to device / b / #, etc.

B. MQTT " " (HiveMQ), "-", .. subsciption , . , HiveMQ - http://www.hivemq.com/blog/mqtt-client-load-balancing-with-shared-subscriptions/. , HiveMQ , . MQTT - URL- :)

C: Node -RED , HTTP- Node -RED ( 1)

D: C Apache Kafka. MQTT Kafka. , . , Node -red flow, Kafka, . , .

- http://www.narendranaidu.com/2016/07/scaling-node-red-horizontally-for-high.html

+4

Source: https://habr.com/ru/post/1648678/


All Articles