Intermittent EADDRINUSE on Syslog TCP Source
Occasionally when looking at the Status of my Syslog Source, which has a configured TCP Port of 51111 : Error: Initialization error: bind EADDRINUSE 0.0.0.0:51111
I don't have any other Sources or Destinations on the machine configured to leverage that port.
I don't see there error on application startup either.
Answers
-
What your facing is likely Ephemeral Ports, which are short lived ports leveraged by the Operating System. Your configured TCP Port is pretty high, and likely falls within the range of the Ephemeral Ports. You can read about ephemeral ports here: The Ephemeral Port range for your system can usually be found by checking
proc/sys/net/ipv4/ip_local_port_range
Example:# cat /proc/sys/net/ipv4/ip_local_port_range 32768 60999
So what's likely happening here is the Operating System just so happens to leverage an ephemeral port that is the same port as your configured TCP source.
This is an OS related function, outside of Stream's control.
Your TCP Syslog Port just so happens to fall within the default range.1