user170008 user170008 - 16 days ago 6
Apache Configuration Question

Disabling reallocation of a resource with Apache Helix 0.7.1

My use case is to disable the auto reallocation by Helix to a new node temporarily.

I tried using the


ZKHelixAdmin.enableResource()


API. I see a change in the ideal state[


{ "HELIX_ENABLED" : "false",...}


] in the Exhibitor but the same resource is getting reallocated to a live instance.

What is the functionality of enableResource() API?The API doc doesn't have much info.

Answer

The balancer checks if the resource is enabled and only if its enabled it will allocate it to another live instance.

In my case, I was using a custom re balancer[was using the USER_DEFINED rebalancer algorithm] and had to add this check explicitly in my custom re balancer.

Works like a charm.