users@glassfish.java.net

Re: Cluster sometimes stops without any exception

From: Fialli Joe <joe.fialli_at_oracle.com>
Date: Tue, 27 Nov 2012 12:19:29 -0500

On 11/27/12 7:30 AM, forums_at_java.net wrote:
> No, the address and port are not specified when configuring glassfish.
> Is it
> possible to somehow end up having the same ip address and port after
> using a
> "% asadmin create-cluster" approach tens of times on hundreds of
> machines on
> the same network?

Rather than venture a guess, I will just state the ranges that these are
getting generated from.

The multicast port is a random number selected between 2048 to 32000
when the "asadmin create-cluster" command is run.
It is recorded and placed in the domain.xml configuration file.
The default ephemeral port range is 32k to 64k on some OS.

One can manually set the multicastport for each cluster (thus managing
no collisions when many clusters are being created)
by providing a multicastport between 2048 to 49151 as the parameter
--multicastport to the "asadmin create-cluster" command.
(to use between 32k to 49k, the native OS means for specifying the
ephemeral port range must be used to ensure no collisions
between ephemeral port range (used for generation of network client
socket temporary ports).

For generating the multicast group address, the first 2 parts of the IP
address are fixed at "228.9" as your addresses were. So the
address is very likely generated. However, the last 2 parts of the
multicast group address are generated as random numbers between
0-255.

Copying of the domain.xml may be more likely than a 3 way collision that
you reported, but it is definitely not impossible.

If the above randomness is not sufficient for your frequency of creating
clusters with same name,
the ability to explicitly set the multicast group address and/or
multicast port is the means
to avoid collisions if the automated, default mechanism is not sufficient.

-Joe


>
> --
>
> [Message sent by forum member 'sebigavril']
>
> View Post: http://forums.java.net/node/892700
>
>