无法连接Microsoft Azure Vm中的端口 [英] Could not connect Port in Microsoft Azure Vm

查看:876
本文介绍了无法连接Microsoft Azure Vm中的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



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



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

 主持人:80 
主持人:8080
主持人:8081

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



我已经按照



netstat -tuplen

 (并非所有流程都可以识别,非自有流程信息
将不会显示,您必须是root才能看到它。)
活动Internet连接(仅限服务器)
Proto Recv-Q Send-Q本地地址外部地址状态用户Inode PID /程序名称
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本地地址:Port Peer地址: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 ::: *


解决方案

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



我注意到你使用jetty容器,jetty默认使用IPv6。您可以允许jetty force使用IPv4。有一个很好的答案


I have created Red Hat VM in Microsoft Azure and able to connect via ssh.

I have started Java server in VM with port 8081 and it started successfully. But I am not able view it in browser. Its doesn't get loaded.

I have tried the following and but all doesn't get loaded:-

host:80
host:8080
host:8081

I have added Inbound security rule in Network security Group and associated subnet to it. Still I am not able view my server in browser.

I have followed this document for inbound security rule

Here is my inbound rule

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 :::* 

解决方案

According to your screenshot, I notice that your service is listening on tcp6. Based on my knowledge, if the port only provides ipv6 service, you could not use IPv4 address to access.

I notice that you use jetty container, jetty use IPv6 by default. You could allow jetty force to use IPv4. There is a good answer about this.

这篇关于无法连接Microsoft Azure Vm中的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆