服务器到 AWS RDS - 无法建立连接,因为目标机器主动拒绝它 [英] Server to AWS RDS - No connection could be made because the target machine actively refused it

查看:52
本文介绍了服务器到 AWS RDS - 无法建立连接,因为目标机器主动拒绝它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将网站从专用服务器迁移到 AWS.

I'm moving a website from a dedicated server to AWS.

首先我要传输数据库(sql server express).

First I want to transfer the database (sql server express).

我已经设置了一个 AWS RDS Sql Express 数据库 - 并且可以从我的 PC 连接到它.但是,当我更新当前服务器上的数据库连接字符串时 - 指向 AWS RDS Sql Express,我收到错误:

I've setup an AWS RDS Sql Express database - and can connect to it from my PC. However when I update the database connection string on my current server - to point to the AWS RDS Sql Express, I get the error:

[Win32Exception (0x80004005): 由于目标机器主动拒绝,无法建立连接]

[Win32Exception (0x80004005): No connection could be made because the target machine actively refused it]

[SqlException (0x80131904):建立与 SQL Server 的连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接.(提供者:TCP 提供者,错误:0 - 无法建立连接,因为目标机器主动拒绝.)]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)]

RDS 所属的安全组开放了以下端口:

The Security Group the RDS belongs to has the following ports open:

一个 IP,是我的本地 PC - 另一个是我的专用服务器 IP.

One IP, is my local PC - the other is my dedicated server IP.

知道为什么我的本地 PC 会连接到 AWS RDS Sql Express 实例,但我的专用服务器连接被拒绝吗?

Any idea why my local PC will connect to the AWS RDS Sql Express instance, but my dedicated servers connection is refused?

有什么方法可以找到我的服务器尝试连接到 AWS 的 IP 地址(如果它不是面向公众的)?

Is there any way I can find what IP address my server is trying to connect to AWS with (if it's not the public facing one)?

感谢您的建议.

标记

推荐答案

你应该检查两件事:

1- rds 端点是否正确(在我的情况下,端点是错误的)

1- the rds endpoints whether it is correct or not (in my case the endpoint was wrong)

2- rds 的 public 可访问性设置为 true 并且其安全组允许您的 ip

2- the rds got public accessible set to true and its security group allows your ip

这篇关于服务器到 AWS RDS - 无法建立连接,因为目标机器主动拒绝它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆