Hi Shi,

Thanks for your response.

The Helix documentation suggests that the recommended way to name instances is to use a combination of host name and port number. I suppose adding the port number allows multiple instances to run on the same machine. However, this also means that each instance needs to be provided a dedicated port number that is known upfront and is ensured to be stable across cluster restarts.

In my particular application, no assumption is made about the availability of specific ports on the machine that runs the agent. Instead, the agent on startup opens a socket with port 0, getting a free port assigned to the socket, which is then used for further communication with that agent for the duration that the agent is alive. This strategy of not depending on specific ports allows us to run multiple agents on the same machine (mostly for testing) without worrying about the agents trying to bind to the same port for RPC. In production this scheme let's our agents run on the server machines without regards to what ports are available and allowing for zero-configuration.

I am in the process of porting this application to use Helix as the cluster management platform and trying to figure out what the best way would be to do so. To get around the problem, I think I will need to figure out a more stable way to name my instances so that they maintain their name regardless of which port they are bound to.

Have you encountered other use cases that needed an alternate way to name the instances instead of using hostname and port numbers?

Thanks,
Vinayak


Hi Vinayak:

In this scenario, Helix admin command / API (see
http://helix.incubator.apache.org/Tutorial.html) can be used to add the
instance with the new generated name into the cluster, and then the
instance can start with the name. But doing this may require the idealstate
of the resource hosted in the helix cluster be re-calculated after the new
instance is added, unless the resource is in auto-rebalance mode.

Can you share some more details about your use case?

Thanks,
-Shi

On Mon, Feb 25, 2013 at 1:29 PM, Vinayak Borkar <[email protected]> wrote:

Hi guys,


I am trying to use Helix in a system where the "instances" start up and
listen on a free port that is not pre-configured before the application
starts -- This is done so that the application does not rely on the
availability of specific ports. As a result, the instance name (host, port)
are not know upfront. However, Helix requires the instance be created in
Helix before it connects. Any ideas to get out of this situation? Is there
a way to tell Helix to create an instance on receiving a connection from an
instance?

Thanks,
Vinayak

Reply via email to