Windows Azure 上的 mySQL 连接超时

发布于 2024-10-15 07:20:05 字数 2346 浏览 7 评论 0原文

我们有一个与多个第三方系统集成的 Windows Azure 应用程序(Lokad.CQRS 架构)。其中一项集成发生在 mySQL 上。一切都很顺利,但最近我们遇到了一个 Windows Azure 应用程序无法连接到的 mySQL 数据库,导致超时。

以下是相关的堆栈跟踪:

System.TimeoutException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ---> 
System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. --->
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
--- End of inner exception stack trace ---
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32  offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlConnection.Open()

重要亮点:

  • 可从 Windows Azure 访问目标数据库(通过 MySQL Workbench 连接时使用端口转发进行验证);
  • 与目标数据库的集成可以从本地 Azure Dev Fabric 正常工作;
  • Windows Azure 上的 Booth 池化和非池化连接会出现问题。
  • TCP/IP,常用端口,无 SSL;
  • 此操作的连接超时足够大 - 5 秒,并且连续失败(但在距离 NE DC 不远的非 Azure 计算机上总是成功)

我们通过 Lokad.CQRS 提供 Oracle、MS SQL、mySQL 和 PostgreSQL 连接Windows Azure 的各种设置和配置(Linux/Windows 托管的数据库服务器)。但这个特定的 mySQL 案例让我完全困惑。

对可能导致问题的原因有任何猜测吗?

We have a Windows Azure Application (Lokad.CQRS architecture) that integrates with multiple 3rd party systems. One of these integrations takes place on mySQL. Everything was going good, but lately we've got one mySQL database that Windows Azure application can't connect to, resulting in timeout.

Here's the relevant stack trace:

System.TimeoutException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ---> 
System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. --->
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
--- End of inner exception stack trace ---
at MyNetworkStream.HandleOrRethrowException(Exception e)
at MyNetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.TimedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.ReadFully(Stream stream, Byte[] buffer, Int32  offset, Int32 count)
at MySql.Data.MySqlClient.MySqlStream.LoadPacket()
at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlConnection.Open()

Important highlights:

  • target database is accessible from Windows Azure (used port forwarding to verify while connecting via the MySQL Workbench);
  • integration with the target DB works properly from the Local Azure Dev Fabric;
  • Problem on Windows Azure happens for booth pooled and non-pooled connections.
  • TCP/IP, usual port, no SSL;
  • connection timeout for this operation is large enough - 5 seconds and it continuously fails (but always succeeds from non-Azure machine located not far away from the NE DC)

We have Oracle, MS SQL, mySQL and PostgreSQL connectivity working from Lokad.CQRS over the Windows Azure in various setups and configurations (Linux/Windows-hosted database servers). But this specific mySQL case is just completely confusing me.

Any guesses on what might be causing the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

楠木可依 2024-10-22 07:20:05

解决方案:

由于某种原因,Azure Production Fabric 为连接到目标数据库添加了过多的延迟,因此总是超时。来自欧洲附近机器的相同连接从未中断连接超时。

增加此特定案例的连接超时(增加 5 倍)确实解决了该问题,并且没有给分布式系统的其余部分增加太多风险。

问题可能出在 NE DC 的网络配置、路由器故障或其他原因。

Solution:

For some reason Azure Production Fabric was adding too much latency to connection to the target database, it was always timing out. Same connection from the machine nearby in Europe never broke the connection timeout.

Increasing connection timeouts for this specific case (by 5x) did solve the case, without adding too much risk for the rest of the distributed system.

Probably the problem was in the network configuration at NE DC, faulty router or whatever.

不再让梦枯萎 2024-10-22 07:20:05

我刚刚联系您是想问您一些问题,因为我们希望追踪这个问题并帮助确保我们在 Windows Azure 上运行的操作系统应用程序没有问题。如果您没有看到,请告诉我。

贾斯·桑德胡,@jassand
互操作性策略团队
http://interoperabilitybridges.com
http://blogs.msdn.com/interoperability

I just pinged you to ask you a bunch of questions as we'd like to trace this issue and help make sure we have no problems with oss apps running on Windows Azure. Let me know if you do not see it.

Jas Sandhu, @jassand
Interoperability Strategy Team
http://interoperabilitybridges.com
http://blogs.msdn.com/interoperability

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文