I have about 20 java processes that start with
-Dcom.sun.management.jmxremote
on its command line without specifying the specified port number.
I understand that this means that the JVM gets any free port from the ephemeral range of ports.
It worked without problems for many years.
Last week, I had a one-time event when some of the processes did not start due to the following:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 0; nested exception is:java.net.BindException: Address already in use
The problem does not reproduce, and I have not seen this before.
As I understand it, Port 0 is another term for any ephemeral port. Since they are assigned by the JVM system, how can the ephemeral port be used?
[me@server:/tmp]cat /proc/sys/net/ipv4/ip_local_port_range
32768 61000
About 29,000 ports should be available; does this error indicate that they were all used at the time my processes requested them?