我们在West-1(加利福尼亚州北部)有一些MySQL RDS实例,并希望使用QuickSight创建一些报告。第一个问题是QuickSight仅在West-2(俄勒冈州)中可用,并且没有显示我们的RDS,因此我在West-2中创建了一个只读副本数据库。
我仍然无法连接到我的实例,它显示以下错误: 连接失败。确保您的实例可从相应的Amazon QuickSight IP地址范围访问。
我已经在入站规则中创建了一个允许IP 54.70.204.128/27的安全组,并将其应用于我的实例。最终允许我连接到实例的是设置“公开可用”'实例的字段为'是'。
然而,我的老板更喜欢留下“不”。我们还可以使用MySQL SSH连接方法通过DOMO连接到非公共实例。
是否可以在不将Publicly Accessible设置为Yes的情况下使QuickSight和RDS之间的连接正常工作?
答案 0 :(得分:2)
我在AWS上创建了一个关于此的支持请求,他们的答案如下。我试试看。
嗨Alistair,
感谢您与AWS Premium Support联系。我很乐意今天为你提供帮助。
我知道您想从QuickSight连接到您的Prod RDS数据库,但是您收到错误:“未经验证”。您还想知道是否有解决方法可以看到您的RDS实例无法公开访问。
Amazon Web Services提供名为CloudFormation的服务,此服务可帮助自动执行某些流程。 此服务将允许您的RDS实例通过自定义NAT实例连接到QuickSight。因此,您不必将数据库放在公有子网中。 附件是CloudFormation模板(NAT_RDS_Provisioning.template),在启动CloudFormation堆栈[1]后,将创建一个实例和一个安全组,然后输入所需的变量。 然后,这将从您定义的源端口上的源地址访问EC2实例的端点,然后允许QuickSight访问您的RDS实例服务器,而不会公开您的RDS实例。
要启动此CloudFormation堆栈,请参阅以下步骤...请注意,您在此处创建的区域必须与数据库所在的区域相同。
1. From your AWS console navigate to " CloudFormation "
2. Click " create stack ", you will then be asked to Select Template, you will then select " Design template".
3. Next to Parameters - click " Mappings ", at the bottom of that page you will see: Components and Template.
4. Select " Template " and copy and paste the provided script in there. (see attached: NAT_RDS_Provisioning.template)(Please use case link below signature)
5. In the top right hand corner you will see a refresh button, click to refresh.
6. On the top left there is a square with a tick inside (clicking this validates the template).
7. Once validated - click the little cloud with the arrow in it , this will create the stack.
8. You will be taken back to the select template page, click "next" in the bottom right corner.
9. Under Specify Details, name your stack and then complete all Parameters, info on parameters provided below:
9.1 Stack name (Example: NAT-RDS-QuickSight)
9.2 DestinationAddress - Add your RDS instance Endpoint here. (That way when a fail-over occurs the endpoint should be updated in 60 seconds maximum).
9.3 DestinationPort - The service remote destination port:
9.4 InstanceType - The EC2 instance class. (The size of the NAT instance will depend on the amount of data you want to pull into QuickSight)
9.5 KeyName - Name of an existing EC2 KeyPair to enable SSH access to the instance:
9.6 SourceAddress - The source range you want to allow access from: example 0.0.0.0/0.
9.7 SourcePort - The port the service must listen on:
9.8 Subnet - a Public Subnet that is in the same VPC as your RDS instance:
10. Click " Next "
11. On the Options page - complete the desired fields and click " Next " (Optional)
12. Review all information - (Confirm the details for your NAT EC2 instance)
13. Under template you will see "Estimate cost - click on cost to give you an idea of the monthly estimate to have this service running)
14. Then select " Create " in the bottom right hand corner.
15. On the main CloudFormation Page, click "refresh" You will the notice the status of your Stack being created.
16. If you navigate to your EC2 console you will notice your NAT instance running / creating.
请确保NAT实例可以访问您的RDS实例,包括安全组设置。 这应该通过在RDS实例数据库的安全组中包含NAT实例的IP地址来完成。
然后,您应该能够以设置方式访问EC2 IP地址和端口,然后将流量转发到您的数据库。
创建上述内容时,您会看到所涉及的估算费用,但我在下面添加了两个链接,以获取更多相关信息以及费用计算器。
成本与EC2实例相同,这将启动AWS Linux最新标准AMI,吞吐量将由实例类[2]& [3]:
[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html
[2] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html
[3] https://calculator.s3.amazonaws.com/index.html
我希望上述信息和解决方案有所帮助。
如果您遇到任何上述任何困难,或者您不确定任何事情,请自由联系我,我将非常乐意为您提供帮助。
要查看此通信中包含的名为“NAT-RDS-Provisioning-Template.template”的文件,请使用签名下方的案例链接。
致以最诚挚的问候,
Delene T. 亚马逊网络服务
请在此处查看提供的模板文件内容:https://pastebin.com/m67sz4bR
答案 1 :(得分:1)
您的RDS副本是否在VPC中?
首先识别,然后相应地创建一个安全组并附加必要的规则!
我建议你阅读Authorizing Connections from Amazon QuickSight to Amazon RDS Instances
答案 2 :(得分:0)
幸运的是,事情已经改变。
可以将Amazon QuickSight连接到VPC中RDS中的数据库,尽管AWS文档尚不清楚所有必要步骤。
基本上,请按照此处的步骤操作, https://docs.aws.amazon.com/quicksight/latest/user/working-with-aws-vpc.html 但请确保您将创建两个安全组:
让我们从第二个开始: 它是QuickSight分配给网络接口(ENI)的一个接口,它将在您的VPC中自动创建以访问数据库。这是我一开始错过的内容,而这是您用于在QuickSight中创建VPC连接的内容。详细信息在上述文档的“ Amazon QuickSight弹性网络接口的安全组规则”部分。
第一个看起来像这样: 入站:根据数据库的TCP /端口-在MySQL中为“ MYSQL / Aurora,TCP, 3306”,来源:以前的安全组。 不要忘记将其添加到您的数据库实例中。
祝你好运。