我们有一个与多个第 3 方系统集成的 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 上的问题发生在展位池连接和非池连接。
- TCP/IP,普通端口,无 SSL;
- 此操作的连接超时足够大 - 5 秒,并且它连续失败(但总是在距离 NE DC 不远的非 Azure 机器上成功)
我们有 Oracle、MS SQL、mySQL 和 PostgreSQL 连接,通过 Lokad.CQRS 在 Windows Azure 上以各种设置和配置(Linux/Windows 托管的数据库服务器)工作。但是这个特定的 mySQL 案例完全让我感到困惑。
关于可能导致问题的任何猜测?