dev@glassfish.java.net

Re: mysterious ports

From: Joseph Fialli <joe.fialli_at_oracle.com>
Date: Fri, 10 Sep 2010 11:30:22 -0400

  comments inline below.

On 9/10/10 10:53 AM, Tom Mueller wrote:
> I've been looking at the ports that cluster members listen on, and I'm
> seeing some mysterious ports. Can someone please identify what these
> ports are being used for? Also, how are the port numbers allocated?
>
> Here are the ports used by a typical instance, running without GMS
> enabled and with JMS in embedded mode:
>
> TCP *:28081 (LISTEN) < HTTP_LISTENER_PORT
> TCP *:28182 (LISTEN) < HTTP_SSL_LISTENER_PORT
> TCP *:24849 (LISTEN) < ASADMIN_LISTENER_PORT
> TCP 127.0.0.1:26667 (LISTEN) < OSGI_SHELL_TELNET_PORT
> TCP *:27677 (LISTEN) < JMS_PROVIDER_PORT
> TCP *:27777 (LISTEN) < ?????
> TCP *:16426 (LISTEN) < ?????
> TCP *:52978 (LISTEN) < ?????
> TCP *:32874 (LISTEN) < ?????
> TCP *:4910 (LISTEN) < ?????
> TCP *:28687 (LISTEN) < JMX_SYSTEM_CONNECTOR_PORT

Here are a list of PORTs list in one of my clustered instances domain.xml.

<system-property name="GMS_LISTENER_PORT-myCluster"
value="9493"></system-property>
<system-property name="JMX_SYSTEM_CONNECTOR_PORT"
value="28688"></system-property>
<system-property name="JMS_PROVIDER_PORT" value="27678"></system-property>
<system-property name="ASADMIN_LISTENER_PORT"
value="24850"></system-property>
<system-property name="HTTP_LISTENER_PORT" value="28082"></system-property>
<system-property name="IIOP_LISTENER_PORT" value="23702"></system-property>
<system-property name="IIOP_SSL_LISTENER_PORT"
value="23822"></system-property>
<system-property name="JAVA_DEBUGGER_PORT" value="29011"></system-property>
<system-property name="OSGI_SHELL_TELNET_PORT"
value="26668"></system-property>
<system-property name="HTTP_SSL_LISTENER_PORT"
value="28183"></system-property>
<system-property name="IIOP_SSL_MUTUALAUTH_PORT"
value="23922"></system-property>

Potentially 3 of the ports above are IIOP variants.

If no GMS_LISTENER_PORT-myCluster is specified, GMS selects a port in
the range 9090 and 9120 for its tcp port.
The gms multicastport is specified on cluster element multicastport
attribute. This is randomly generated
between 2048 and 32000 if one is not specified on commandline when
creating the cluster
This value needs to be the same on all clustered instances in the cluster.
We can not use ports in the ephemeral port range (that you mentioned in
last message). The ephemeral
port range is for client sockets. Server side sockets should not be in
ephemeral port range to eliminate
accidental collision with tcp client sockets. (This happened a lot in
glassfish v2.1 with gms testing
before I started having the GMS testers set the ephemeral port range to
be exclusive of the
static server side port ranges listed in glassfish domain.xml. Since
GMS and HA has moved from
jxta client pipes to using grizzly, we have not suffered from ephemeral
ports conflicting with the
static server ports listed in glassfish domain.xml.

-Joe
>
> The concern that I have with these ports is that they appear to be
> dynamically allocated, because they change each time the instance is
> run and for different instances, but except for one, they are
> allocated from the outside the region for allocating dynamic ports
> (which is 49152 to 65535). And if the port number chosen happens to be
> the one that another instance on the same system is going to use, then
> that instance will fail to start because it can't bind to it's port.
>
> I also curious as to what determines the address that these sockets
> are bound too, for the multihomed server use case.
>
> Thanks.
> Tom
>
>
>