无法连接Microsoft Azure Vm中的端口

时间:2016-12-22 13:40:21

标签: java http azure virtual-machine port

我在Microsoft Azure中创建了Red Hat VM,并且能够通过ssh进行连接。

我已经在VM中使用端口8081启动了Java服务器并且它已成功启动。但我无法在浏览器中查看它。它没有加载。

我尝试过以下操作,但所有内容都没有加载: -

host:80
host:8080
host:8081

我已在网络安全组及其关联的子网中添加了入站安全规则。我仍然无法在浏览器中查看我的服务器。

我已按照此document了解入站安全规则

这是我的入境规则enter image description here

netstat -tuplen

(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name 
tcp 0 0 127.0.0.1:29131 0.0.0.0:* LISTEN 0 20864 - 
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 13894 - 
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 18132 - 
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 994 19499 - 
tcp6 0 0 :::111 :::* LISTEN 0 13893 - 
tcp6 0 0 :::8081 :::* LISTEN 1000 28721 3212/java 
tcp6 0 0 :::22 :::* LISTEN 0 18143 - 
tcp6 0 0 :::9080 :::* LISTEN 1000 28547 3212/java 
udp 0 0 0.0.0.0:68 0.0.0.0:* 0 16585 - 
udp 0 0 0.0.0.0:111 0.0.0.0:* 0 23825 - 
udp 0 0 127.0.0.1:323 0.0.0.0:* 995 15601 - 
udp 0 0 0.0.0.0:45876 0.0.0.0:* 0 16574 - 
udp 0 0 0.0.0.0:893 0.0.0.0:* 0 23826 - 
udp6 0 0 :::57126 :::* 0 16575 - 
udp6 0 0 :::111 :::* 0 23827 - 
udp6 0 0 ::1:323 :::* 995 15602 - 
udp6 0 0 :::893 :::* 0 23828 - 

ss -tln

State Recv-Q Send-Q Local Address:Port Peer Address:Port 
LISTEN 0 10 127.0.0.1:29131 *:* 
LISTEN 0 128 *:111 *:* 
LISTEN 0 128 *:22 *:* 
LISTEN 0 128 127.0.0.1:27017 *:* 
LISTEN 0 128 :::111 :::* 
LISTEN 0 50 :::8081 :::* 
LISTEN 0 128 :::22 :::* 
LISTEN 0 50 :::9080 :::* 

1 个答案:

答案 0 :(得分:2)

根据您的截图,我注意到您的服务正在侦听tcp6。根据我的知识,如果端口只提供ipv6服务,则无法使用IPv4地址进行访问。

我注意到你使用jetty容器,jetty默认使用IPv6。您可以允许jetty force使用IPv4。关于此问题有一个很好的answer