sql-server – SQL Azure – 连接失败 – 但没问题?

前端之家收集整理的这篇文章主要介绍了sql-server – SQL Azure – 连接失败 – 但没问题?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们最近在生产部署过程中将客户端迁移到sql Azure平台.通过所有外在的迹象,它是成功的:连接到它的网络应用程序都在工作.

但是,当我们查看Azure监视器时,我们会看到许多连接失败.我们找不到太多文档来解释什么构成失败的连接.我们的用户都没有报告问题.有谁知道这可能是怎么回事?

使用本文中的示例查询(View Connection Issues on an SQL Azure Instance)

SELECT      
            [Date From] = EL.[start_time],[Date To] = EL.[end_time],[Database Name] = EL.[database_name],[Event Type] = EL.[event_type],[Event Sub Type] = EL.[event_subtype_desc],[Description] = EL.[description],[Additional Data] = EL.additional_data
FROM sys.event_log EL
WHERE EL.event_type != 'connection_successful'
AND EL.event_subtype_desc != 'idle_connection_timeout'
ORDER BY [Date From] DESC

我们看到这样的结果:

2013-04-19 16:40:00.0000000 2013-04-19 16:45:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:40:00.0000000 2013-04-19 16:45:00.0000000             connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:35:00.0000000 2013-04-19 16:40:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:35:00.0000000 2013-04-19 16:40:00.0000000             connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:30:00.0000000 2013-04-19 16:35:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:30:00.0000000 2013-04-19 16:35:00.0000000             connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:25:00.0000000 2013-04-19 16:30:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:25:00.0000000 2013-04-19 16:30:00.0000000             connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:20:00.0000000 2013-04-19 16:25:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:20:00.0000000 2013-04-19 16:25:00.0000000             connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL
2013-04-19 16:15:00.0000000 2013-04-19 16:20:00.0000000 [DATABASE]  connection_Failed   blocked_by_firewall Client IP address is not allowed to access the server.  NULL

以及我们的连接字符串示例,如下所示:

<add name="[MyContext]"
     providerName="System.Data.sqlClient"
     connectionString="
      Server=tcp:[machine].database.windows.net,1433;
          Database=[database];
          User ID=[user]@[machine];
          Password=[password];
          Trusted_Connection=False;
          Encrypt=True;
          Connection Timeout=30;"/>

解决方法

因此,自推出的第一天起,我们就再也没有看到失败的连接.我目前的想法是,Azure端可能有一个后端进程无法正常使用新实例,但由于我们没有更改任何内容,因此已停止或已修复.我会让它再坐几天,如果我们没有看到任何问题,请将其归结为环境设置故障.

这是一周左右的状态.不是一个使用频繁的网站,但没有任何连接错误的迹象.

原文链接:https://www.f2er.com/mssql/78048.html

猜你在找的MsSQL相关文章