我从Azure Data Science虚拟机上托管的SSMS连接到我的Azure sql数据库。我遇到了连接到Azure SQL数据库的频繁连接。
连接断开时我观察到以下模式:
DSVM加入了我们客户的域,我们通过Citrix连接到它。请提供修复间歇性连接问题的任何建议。
以下是我所做的一些故障排除的详细信息。
这似乎是一个DNS解析问题,因为您可以在与我们共享的第一个屏幕上阅读。您似乎有间歇性的DNS名称解析。
打开命令提示符窗口并使用PING命令确认名称解析成功将逻辑服务器名称转换为IP地址。预期下面显示的“请求超时”消息是因为SQL数据库永远不会响应ping请求。
C:\>ping <myserver>.database.windows.net
Pinging data.sn1-1.database.windows.net [65.55.74.144] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 65.55.74.144:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)
如果此步骤间歇性失败,请与网络管理员,Citrix管理员或Internet服务提供商联系,以获取有关修复名称解析问题的帮助。
接下来,从命令提示符窗口,尝试使用前一步骤中返回的IP地址telnet到端口1433。这将测试是否有任何防火墙/路由器阻止到端口1433的流量。
C:\>telnet 65.55.74.144 1433
Connecting To 65.55.74.144...
a。如果Telnet成功,窗口将变为完全空白的屏幕。退出并继续下一步。 b。如果不成功,请捕获输出并将其与tracert输出一起提供给网络管理员或Citrix管理员。
接下来,从命令提示符窗口,通过尝试telnet到DNS名称而不是IP地址来重复测试。
C:\>telnet <myserver>.database.windows.net 1433
注意:如果Telnet不是默认Windows安装的一部分,则可以从“添加/删除Windows组件”中启用它。
最后,为了隔离网络问题,使用像this之类的Microsoft网络监视器工具生成网络跟踪。
通过添加过滤器TCP.port == 1433查看跟踪,该过滤器将在TCP端口1433上显示对话。如果您没有从服务器看到ACK,则很可能是在您的网络或互联网上阻止了连接。
来自未成功连接的网络代码段:
11:12:27.007 25 {TCP:7, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:Flags=......S., SrcPort=49411, DstPort=1433, PayloadLen=0, Seq=2375502765, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192
11:12:30.007 26 {TCP:7, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #25]Flags=......S., SrcPort=49411, DstPort=1433, PayloadLen=0, Seq=2375502765, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192 11:12:36.007 29 {TCP:7, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #25]Flags=......S., SrcPort=49411, DstPort=1433, PayloadLen=0, Seq=2375502765, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 819211:12:48.014 40 {TCP:12, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:Flags=......S., SrcPort=49412, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=3206081271, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192
11:12:49.015 41 {TCP:13, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:Flags=......S., SrcPort=49413, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1361088072, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192
11:12:49.019 42 {IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net ICMP ICMP:Echo Request Message, From 111.11.11.111 To 65.55.74.144
11:12:50.769 45 {IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net ICMP ICMP:Echo Request Message, From 111.11.11.111 To 65.55.74.144
11:12:51.014 46 {TCP:12, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #40]Flags=......S., SrcPort=49412, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=3206081271, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192 11:12:52.015 47 {TCP:13, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #41]Flags=......S., SrcPort=49413, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1361088072, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 819211:12:52.771 48 {TCP:14, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:Flags=......S., SrcPort=49414, DstPort=NETBIOS Session Service(139), PayloadLen=0, Seq=265110652, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192
11:12:55.771 49 {TCP:14, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #48]Flags=......S., SrcPort=49414, DstPort=NETBIOS Session Service(139), PayloadLen=0, Seq=265110652, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192 11:12:57.021 52 {TCP:12, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #40]Flags=......S., SrcPort=49412, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=3206081271, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192 11:12:58.016 53 {TCP:13, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #41]Flags=......S., SrcPort=49413, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=1361088072, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192 11:13:01.771 56 {TCP:14, IPv4:6} 111.11.11.111 data.sn1-1.database.windows.net TCP TCP:[SynReTransmit #48]Flags=......S., SrcPort=49414, DstPort=NETBIOS Session Service(139), PayloadLen=0, Seq=265110652, Ack=0, Win=8192 ( Negotiating scale factor 0x8 ) = 8192
在这里,我们可以看到客户端正在尝试建立与SQL数据库的连接,并保持三次重传并失败
成功连接的跟踪片段:
14:50:01.512 847 SQLCMD.EXE {TCP:428, IPv4:427} 99.99.999.99 157.54.118.18 TCP TCP:Flags=......S., SrcPort=13415, DstPort=1433, PayloadLen=0, Seq=4009972475, Ack=0, Win=8192 ( Negotiating scale factor 0x2 ) = 8192
14:50:01.515 848 SQLCMD.EXE {TCP:428, IPv4:427} 157.54.118.18 99.99.999.99 TCP TCP:Flags=...A..S., SrcPort=1433, DstPort=13415, PayloadLen=0, Seq=2117383693, Ack=4009972476, Win=8192 ( Scale factor not supported ) = 8192
14:50:01.516 849 SQLCMD.EXE {TCP:428, IPv4:427} 99.99.999.99 157.54.118.18 TCP TCP:Flags=...A...., SrcPort=13415, DstPort=1433, PayloadLen=0, Seq=4009972476, Ack=2117383694, Win=17040 (scale factor 0x0) = 17040
上面的代码段表示成功的三次握手。