ShiningRush / fastflow

A lightweight, high-performance distributed workflow framework
MIT License
348 stars 80 forks source link

About Leader and Workers #31

Closed teyenliu closed 1 year ago

teyenliu commented 1 year ago

Let's say if I want to have three workers (included leader), how to run these on a server? Could you give an example? Thanks.

ShiningRush commented 1 year ago

The recommended running method is to use statefulset to run three pods in a k8s environment. The leader node will be automatically elected from these three pods. The workerkey during component initialization can be obtained by injecting the podname as an environment variable. If you are not in a container environment, you need to manually specify the worker-key for these three processes to ensure that they are not duplicated.

Later, I will add an example of deploying in a k8s environment for reference in the documentation.

teyenliu commented 1 year ago

That will be great if there is an example of k8s deployment for reference. Thanks.