如何使用HTTP POST / GET请求连接/查询到AWS Neptune实例 [英] How to Connect/Query to AWS Neptune instance using HTTP POST/GET request

查看:168
本文介绍了如何使用HTTP POST / GET请求连接/查询到AWS Neptune实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Fiddler使用Neptune END Point发送HTTP Post请求来连接到Amazon Neptune实例。
但最终出现超时错误。
能否使用提琴手/邮递员通过HTTP请求将Neptune实例连接到?

I am trying to connect to Amazon Neptune instance by sending a HTTP Post request using Neptune END Point via Fiddler. But ending up in timeout error. Can Neptune instance be connected to via HTTP request using fiddler/Postman?

推荐答案

如果在连接时看到超时到数据库,第一步是检查您是否与端点具有网络连接。

If you are seeing timeouts while connecting to the database, the first step would be to check if you have network connectivity to the endpoint.

尝试: telnet端点端口

如果具有连接性,您将看到类似以下内容的信息:

If you have connectivity, you would see something like this:

Trying 172.217.5.110...
Connected to endpoint (172.217.5.110).
Escape character is '^]'

如果这有效,那么任何HTTP客户端都应能够连接到您的数据库。 (CURL,POSTMAN等)

If this does work, then any HTTP client should be able to connect to your database. (CURL, POSTMAN etc)

如果telnet不起作用,则几乎可以肯定您没有正确配置EC2安全组。您需要做的要点是:

If telnet does not work, then it is almost certain that you have not configured your EC2 Security Groups correctly. The gist of what you need to do is:


  1. 创建一个安全组(例如'ec2')并将其附加到您的EC2客户端实例。默认情况下,此安全组应允许到所有IP的出站连接。如果不是这种情况,则添加它。

  1. Create a security Group (say 'ec2') and attach that to your EC2 client instance. By default, this security group should allow outbound connections to all IPs. If that is not the case, add it.

创建一个安全组(例如 db)。在入站规则中,添加一个规则,该规则允许入站TCP连接到您的数据库端口,并将其作为在#1中创建的安全组。

Create a security Group (say 'db'). In Inbound rules, add a rule that allows inbound TCP connections to your database port, and source as the security group created in #1.

现在修改您的Neptune群集,并在其上附加 db。

Now modify your Neptune Cluster, and attach 'db' to it.

安全组更改传播得非常快,因此您应该能够使用telnet进行测试。

Security Group changes propagate pretty fast, so you should be able to test this using telnet.

您可能会发现其他答案,表明您需要数据库和EC2实例位于同一安全组中。这并非完全正确,这只是上述步骤的特例,您可以为数据库和客户端实例使用一个安全组,而不必创建两个安全组。从安全和设计的角度来看,最好是为数据库和客户端实例设置单独的安全组。

You may find other answers that say that you need the database and the EC2 instance to be in the same security group. That is not entirely true, it is just a special case of the steps mentioned above where instead of creating 2 security groups, you can use a single security group for both - db and the client instance. From a security and design perspective, its best if you have separate security groups for your DB and your client instances.

一旦正确配置了所有网络设置,请确认telnet有效。之后,您可以使用所选的客户端发出HTTP请求。例如:

Once you have all the network settings correctly configured, confirm that telnet works. After that you can make HTTP requests using a client of your choice. For example:

>卷曲http:// my-endpoint:port / status

健康

希望这会有所帮助。

这篇关于如何使用HTTP POST / GET请求连接/查询到AWS Neptune实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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