简体   繁体   English

从 kubernetes pod 到 SQL Server 2019 Linux 的登录错误

[英]Login error from kubernetes pod to SQL Server 2019 Linux

I've deployed a .NET app as a pod into a Kubernetes cluster but this error occurred when it tries to connect to a SQL Server 2019 :我已将 .NET 应用程序作为 pod 部署到 Kubernetes 集群中,但是当它尝试连接到 SQL Server 2019 时发生此错误:

A connection was successfully established with the server, but then an error occurred during the pre-login handshake.与服务器成功建立连接,但在登录前握手期间发生错误。 (provider: TCP Provider, error: 0 - No such file or directory) (提供者:TCP 提供者,错误:0 - 没有这样的文件或目录)

System.ComponentModel.Win32Exception (2): No such file or directory System.ComponentModel.Win32Exception(2):没有那个文件或目录

This error doesn't occur if I run the app locally or deploy it as a Linux service using the same connection string:如果我在本地运行应用程序或使用相同的连接字符串将其部署为 Linux 服务,则不会发生此错误:

Data Source=<ip>;Initial Catalog=<DatabaseName>;User Id=<user>;Password=<pass>

Both Encrypt=False and TrustServerCertificate=True don't work. Encrypt=FalseTrustServerCertificate=True都不起作用。

Thanks.谢谢。

I finally found the problem.我终于找到了问题所在。 The real error was actually a connection problem but I've deployed the pod with linked injected and the "No such file or directory" was returned by linkerd (I don't know how or why).真正的错误实际上是一个连接问题,但我已经部署了带有链接注入的 pod,并且 linkerd 返回了“没有这样的文件或目录”(我不知道如何或为什么)。 Removing the injection, I got the real error.删除注入,我得到了真正的错误。 On the server firewall, I opened the 1443 port for the ingress IP which is different from the one presented by the pod to the server.在服务器防火墙上,我为入口 IP 打开了 1443 端口,这与 Pod 提供给服务器的端口不同。 So, I opened a bash inside the pod and with the command curl ipconfig.me/ip I got the real IP.因此,我在 pod 内打开了一个 bash,并使用命令curl ipconfig.me/ip我得到了真正的 IP。 After whitelisting the IP everything works fine even with linkerd.将 IP 列入白名单后,即使使用 linkerd,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 服务器 2019 上的 IIS 上的网站与 SQL Server 2019 CU1 之间的用户“NT AUTHORITY\\ANONYMOUS LOGON”消息登录失败 - Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON' message between website on IIS on Server 2019 and SQL Server 2019 CU1 从 C# 中的 pod 访问 Kubernetes API - Access Kubernetes API from a pod in C# 连接到 SQL 服务器时登录失败错误 - Login Failed Error when connecting to SQL Server ASP.NET 4.5 到 SQL 服务器 2019 的连接字符串 - “与数据库通信时发生错误” - ASP.NET 4.5 Connection string to SQL Server 2019 - "An error occurred while communicating with the database" 什么时候在Kubernetes窗格中? - What time is it in a Kubernetes pod? 应用程序角色通过“登录失败”错误连接到SQL Server - Application Role connect to SQL Server with “Login Failed” error Windows服务SQL Server错误 - “用户登录失败” - Windows Service SQL Server error - “Login failed for user” 如何保护从Java表单应用程序登录SQL Server的密码 - How to secure password for SQL Server login from a java form application SQL 服务器:与服务器建立连接成功,但随后登录过程出错 - SQL Server: A connection was successfully established with the server, but then an error occurred during the login process 从SQL Server反序列化XML时出错 - Error while deserializing XML from SQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM