Sha*_*ika 6 mysql database-connection amazon-web-services amazon-rds amazon-quicksight
我们在 West-1(加利福尼亚北部)有几个 MySQL RDS 实例,并希望使用 QuickSight 创建一些报告。第一个问题是 QuickSight 仅在 West-2(俄勒冈)可用并且没有显示我们的 RDS,所以我在 West-2 中创建了一个只读副本数据库。
我仍然无法连接到我的实例,并显示以下错误:连接失败。确保您的实例可从相应的 Amazon QuickSight IP 地址范围访问。
我已经在入站规则中创建了一个允许 IP 54.70.204.128/27 的安全组并将其应用于我的实例。最终允许我连接到实例的是将实例的“公开可用”字段设置为“是”。
但是,我的老板更喜欢它保持“否”,我们还能够使用 MySQL SSH 连接方法通过 DOMO 连接到非公共实例。
是否可以在不将“公共可访问”设置为“是”的情况下使 QuickSight 和 RDS 之间的连接正常工作?
幸运的是,事情已经改变了。
\n\n可以将 Amazon QuickSight 连接到 VPC 中的 RDS 中的数据库,尽管 AWS 文档并不清楚所有必要的步骤。
\n\n基本上,请按照此处的步骤操作,\n https://docs.aws.amazon.com/quicksight/latest/user/working-with-aws-vpc.html \n但请确保您将创建两个安全组:
\n\n让\xe2\x80\x99s 从第二个开始:\n它是 QuickSight 分配给网络接口 (ENI) 的接口,该网络接口将在您的 VPC 中自动创建以访问数据库。这是我一开始错过创建的连接,也是您在 QuickSight 中用于创建 VPC 连接的连接。详细信息位于上述文档的 \xe2\x80\x9c Amazon QuickSight 弹性网络接口\xe2\x80\x9d 安全组规则段落中。
\n\n第一个看起来像这样:\n入站:根据 DB \xe2\x80\x93 的 TCP / 端口,对于 MySQL,它是 \xe2\x80\x9cMYSQL/Aurora、TCP、\n3306\xe2\x80\x9d,来源:上一个安全组。\n不要忘记将此安全组添加到您的数据库实例。
\n\n祝你好运。
\n我向 AWS 提出了关于此问题的支持请求,他们的答复如下。我会试一下。
\n\n嗨阿利斯泰尔,
\n\n感谢您联系 AWS 高级支持。我很高兴今天能为您提供帮助。
\n\n我了解您想要从 QuickSight 连接到 Prod RDS 数据库,但您收到错误:“未验证”。您还想知道是否有解决方法可以解决您的 RDS 实例无法公开访问的问题。
\n\nAmazon Web Services 提供了一项名为 CloudFormation 的服务,该服务有助于自动化某些流程。\n此服务将允许您的 RDS 实例通过自定义 NAT 实例连接到 QuickSight。因此,您不必将数据库放在公共子网中。\n附件是 CloudFormation 模板 (NAT_RDS_Provisioning.template),启动 CloudFormation 堆栈 [1] 后,将创建一个实例和一个安全组,然后您输入所需的信息变量。\n然后,这将允许从您定义的源端口上的源地址访问 EC2 实例的终端节点,从而允许 QuickSight 访问您的 RDS 实例服务器,而无需将您的 RDS 实例公开。
\n\n要启动此 CloudFormation 堆栈,请参阅以下步骤\xe2\x80\xa6 请记住,您创建此堆栈的区域必须与您的数据库所在的区域相同。
\n\n1. From your AWS console navigate to " CloudFormation " \n2. Click " create stack ", you will then be asked to Select Template, you will then select " Design template".\n3. Next to Parameters - click " Mappings ", at the bottom of that page you will see: Components and Template. \n4. Select " Template " and copy and paste the provided script in there. (see attached: NAT_RDS_Provisioning.template)(Please use case link below signature)\n5. In the top right hand corner you will see a refresh button, click to refresh. \n6. On the top left there is a square with a tick inside (clicking this validates the template). \n7. Once validated - click the little cloud with the arrow in it , this will create the stack.\n8. You will be taken back to the select template page, click "next" in the bottom right corner.\n9. Under Specify Details, name your stack and then complete all Parameters, info on parameters provided below: \n 9.1 Stack name (Example: NAT-RDS-QuickSight)\n 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).\n 9.3 DestinationPort - The service remote destination port: \n 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) \n 9.5 KeyName - Name of an existing EC2 KeyPair to enable SSH access to the instance: \n 9.6 SourceAddress - The source range you want to allow access from: example 0.0.0.0/0.\n 9.7 SourcePort - The port the service must listen on: \n 9.8 Subnet - a Public Subnet that is in the same VPC as your RDS instance:\n10. Click " Next "\n11. On the Options page - complete the desired fields and click " Next " (Optional)\n12. Review all information - (Confirm the details for your NAT EC2 instance)\n13. Under template you will see "Estimate cost - click on cost to give you an idea of the monthly estimate to have this service running) \n14. Then select " Create " in the bottom right hand corner.\n15. On the main CloudFormation Page, click "refresh" You will the notice the status of your Stack being created.\n16. If you navigate to your EC2 console you will notice your NAT instance running / creating.\n
Run Code Online (Sandbox Code Playgroud)\n\n请确保 NAT 实例有权访问您的 RDS 实例,这包括安全组设置。\n这应该通过将 NAT 实例的 IP 地址包含在 RDS 实例数据库的安全组中来完成。
\n\n然后,您应该能够按照设置访问 EC2 IP 地址和端口,然后这会将流量转发到您的数据库。
\n\n创建上述内容时,您会看到所涉及的估计成本,但是我在下面添加了另外两个链接,以获取有关此内容的更多信息以及为您提供的成本计算器。
\n\n成本将与 EC2 实例相同,这将启动 AWS Linux 最新标准 AMI,吞吐量将由实例类 [2] 和 [3] 决定:
\n\n[1] https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/GettingStarted.Walkthrough.html\n[2] https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html\n[3] https://calculator.s3.amazonaws.com/index.html\n
Run Code Online (Sandbox Code Playgroud)\n\n希望以上信息和解决方案对您有所帮助。
\n\n如果您遇到上述任何困难或有任何不确定之处,请随时与我联系,我将非常乐意为您提供帮助。
\n\n要查看此信件中包含的名为“NAT-RDS-Provisioning-Template.template”的文件,请使用签名下方给出的案例链接。
\n\n此致,
\n\nDelene T.\n亚马逊网络服务
\n\n请参阅此处提供的模板文件内容:https://pastebin.com/m67sz4bR
\n\n 归档时间: |
|
查看次数: |
5139 次 |
最近记录: |