mySQL连接在Windows Azure上超时

时间:2011-02-01 16:39:15

标签: .net mysql azure azure-worker-roles lokad-cqrs

我们有一个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进行连接);
  • 与目标数据库的集成可以从Local Azure Dev Fabric正常工作;
  • Windows Azure上的问题发生在展位池和非池化连接上。
  • TCP / IP,通常端口,无SSL;
  • 此操作的连接超时足够大 - 5秒且连续失败(但总是从距离NE DC不远的非Azure计算机成功)

我们通过Windows Azure以各种设置和配置(Linux / Windows托管的数据库服务器)从Lokad.CQRS开始使用Oracle,MS SQL,mySQL和PostgreSQL连接。但是这个特定的mySQL案例让我感到困惑。

对可能导致问题的原因有什么猜测?

2 个答案:

答案 0 :(得分:0)

解决方案:

由于某些原因,Azure Production Fabric在连接到目标数据库时增加了太多的延迟,因此总是超时。来自欧洲附近机器的相同连接从未打破连接超时。

增加此特定情况的连接超时(按5x)确实解决了这种情况,并没有为分布式系统的其余部分增加太多风险。

可能问题出在NE DC的网络配置,路由器故障等等。

答案 1 :(得分:0)

由于我们想要跟踪此问题并帮助确保我们在Windows Azure上运行的oss应用程序没有任何问题,我只是强烈要求您提出一系列问题。如果你没有看到,请告诉我。

Jas Sandhu,@ jassand 互操作性战略小组 http://interoperabilitybridges.com http://blogs.msdn.com/interoperability