应用程序无法启动,声称“端口已在使用中”,但实际上并非如此

应用程序无法启动,声称“端口已在使用中”,但实际上并非如此

应用程序(apache storm)无法开始抛出以下异常

2022-04-12 04:56:13.997 o.a.s.d.u.UIServer main [ERROR] Exception in UlServer 
java.io.I0Exception: Failed to bind to 0.0.0.0/0.0.0.0:8888 
at org.eclipsejettyserver.ServerConnector.openAcceptChannel(ServerConnectorjava346) ~[jetty-server-9.4.14.v20181114jan9.4.14.v20181114] 
at org.eclipsejetty.server.ServerConnector.open(ServerConnectorjava:308) ~[jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114] 
at org.eclipsejetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnectorjava:80) ~[jetty-server-9.4.14.v20181114jar:9.4.14.v20181114] 
at org.eclipsejetty.server.ServerConnector.doStart(ServerConnectorjava:236) ~[jetty-server-9.4.14.v20181114jar.9.4.14-v20181114] 
at org.eclipsejetty.util.component.AbstractUfeCycle.start(AbstractlifeCyclejava:68) ~[jetty-util-9.4.14.v20181114jan9.4.14.v20181114] 
at org.eclipsejetty.server.Server.doStart(Serverjava:394) ~[jetty-server-9.4.14.v20181114.jar9.4.14.v20181114) 
at org.eclipsejetty.util.component.AbstractLifeCycle.start(AbstractlifeCyclejava:68) ~[jetty-util-9.4.14.v20181114jar.9.4.14.v20181114] 
at org.apache.storm.daemon.ui.U1Server.main(U1Serverjaval 79) [storm-webapp-2.2.0jar:2.2.0] 
Caused by: java.net-BindException: Address already in use 
at sun.nio.ch.Net.bindO(Native Method) ~[?:?] 
at sumnio.ch.Net.bind(Netjava:455) ~[?:?] 
at sun.nio.ch.Netbind(Netjava:447) ~[?:?] 
at sun.nio.chServerSocketChannelImpl.bind(ServerSocketChannellmpljava:227) ~[?:?] 
at sumnio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptorjava:80) ~[?:?] 
at org.eclipsejetty.server.ServerConnector.openAcceptChannel(ServerConnectorjava:342) ~[jetty-server-9.4.14.v20181114jan9.4.14.v20181114] 
... 7 more 

不过,移植是免费的,我使用了多种工具(telnetncnetstat)来确保这一点。在另一台使用另一个应用程序的服务器上也发现了同样的行为,但JMV同样基于
操作系统:RHEL 7.9

Java:11.0.12

答案1

尝试检查TCPUDP听众们也

netstat -plantu | grep 8888

你可以使用以下命令检查打开的端口lsof

lsof -i -P -n

示例输出

root@machine:~# lsof -i -P -n
COMMAND     PID        USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
memcached   471    memcache   26u  IPv4   18741      0t0  TCP 127.0.0.1:11211 (LISTEN)
vsftpd      511        root    3u  IPv6   18621      0t0  TCP *:21 (LISTEN)
sshd        516        root    3u  IPv4   16971      0t0  TCP *:22 (LISTEN)
sshd        516        root    4u  IPv6   16980      0t0  TCP *:22 (LISTEN)
mysqld      831       mysql   21u  IPv6   20656      0t0  TCP *:33060 (LISTEN)
mysqld      831       mysql   26u  IPv4   17309      0t0  TCP *:3306 (LISTEN)
apache2   32378        root    4u  IPv6 4392606      0t0  TCP *:80 (LISTEN)
apache2   32378        root    6u  IPv6 4392610      0t0  TCP *:443 (LISTEN)
apache2   32396    www-data    4u  IPv6 4392606      0t0  TCP *:80 (LISTEN)
apache2   32396    www-data    6u  IPv6 4392610      0t0  TCP *:443 (LISTEN)
apache2   32397    www-data    4u  IPv6 4392606      0t0  TCP *:80 (LISTEN)
apache2   32397    www-data    6u  IPv6 4392610      0t0  TCP *:443 (LISTEN)

相关内容