dev@glassfish.java.net

Re: mysterious ports (solved)

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 13 Sep 2010 10:12:42 +0100

Tom,

Tom Mueller wrote, on 10/09/2010 19:12:
> Thanks. The JMS output accounts for all but one of the ports. Here's the output on a later run:
>
> 101 i112i112 4.5
> cluster_discovery tcp CLUSTER_DISCOVERY 0
> portmapper tcp PORTMAPPER 27677
> [imqvarhome=/scratch/gf/glassfishv3/glassfish/nodes/n-ssh-1/i1-1-2/imq,imqhome=/scratch/gf/glassfishv3/mq,sessionid=6488045478229091328]
>
> jmxrmi rmi JMX 0
> [url=service:jmx:rmi://adc6140523/jndi/rmi://adc6140523.us.oracle.com:27777/adc6140523.us.oracle.com/27677/jmxrmi]
> admin tcp ADMIN 48235
> jms tcp NORMAL 49825
> mqdirect2 none NORMAL 0
> jmsdirect none NORMAL 0
> cluster tcp CLUSTER 26225
> .
>
> Here, ports 27777, 48235, 49825, and 26225 are 4 of the mysterious ports (not so mysterious anymore).
>
> And if I disable JMS altogether by putting a <jms-service/> in the domain.xml, then all 5 mysterious ports are gone.
>
> So how does one go about configuring them to be fixed? I looked at the MQ documentation for 3.0 and this didn't jump out
> at me. Also, what would be the expected configuration for a large cluster? Would each instance be running an embedded
> broker? Or should there be some set of brokers that are running independently from the instances (maybe not a 1:1 mapping)?
>
> If the ports need to be unique for each instance, do we need to work this into the automatic port assignment that is
> done when an instance is created?
>
> Thanks.
> Tom
>

Here's the section of the MQ admin guide which describes the various services and the ports that they use:
http://docs.sun.com/app/docs/doc/821-1794/aeocn?l=en&n=1&a=view

See particularly the section describing the port mapper, which explains how these ports are dynamic but can be defined
with static values if necessary to go through firewalls. Static ports is a supported feature but is "not recommended for
general use".

MQ uses the standard JDK API to allocate dynamic (ephemeral) ports which in turn delegates it to the local TCP
implementation. As I understand it, the port range used for dynamic ports will depend on the operating system and each
OS offers its own way to configure the range. On Windows XP, for example, the port range is from 1025 to the value of
the MaxUserPort registry setting.

Nigel