How to connect with Neptune DB
saxenadeepakkumar opened this issue · 5 comments
Hi,
I am new in Neptune database. As, Amazon neptune does not provide functionality to connect from local system directly. So, i have created a tunnel on 8182 port using putty,
Please let me know, how can i connect neptune database from this utility.
Thanks in advance..
Thanks @jwalton for looking into it.
I am using putty tunnel method through EC2 to connect Neptune
I think you meant @jwalton922. I saw this in my inbox, came to this issue, started reading "my" reply, and I really didn't remember writing that. :P
yes @jwalton922 , I am using putty tunnel method through EC2 to connect Neptune. But, after establish connection with tunnel, i am not getting anything while requesting http://localhost:8182/status. Could you please help?
Yep, not documented anywhere. Here's how we got it working:
DO NOT DO THIS FOR A PRODUCTION DATABASE...THIS IS NOT SECURE OR SAFE
You need an EC2 instance with network access to Neptune, you can test the EC2 connectivity to Neptune by running this: "curl -G https://YOUR_NEPTUNE_CLUSTER_ENDPOINT:8182/status" inside of the EC2 to confirm it can connect to the instance.
In Putty:
-
In the Category pane, choose Session and then complete the following fields: For Host Name, enter the public DNS hostname preceeded with the login user for the EC2 (we use Ubuntu) instance (eg: ubuntu@ec2-12-345-678-910.compute-1.amazonaws.com). For Port, be sure that the value is 22.
-
In the Category list, expand Connection > SSH > Auth and in the Private key file for authentication text box enter the path to the .ppk file used for logging into the EC2 box.
Download this locally to your machine and use the path you downloaded to for the Private key file for authentication text box. -
In the Category list, expand Connection > SSH, and then choose Tunnels. Complete the following: For Source port, enter the port that you chose when you created the Neptune cluster, such as 8182. For Destination, enter the Neptune cluster endpoint and port.
Example: mydbcluster.cluster-123456789012.eu-west-1.neptune.amazonaws.com:8182. Select the Local and Auto options. -
Choose Add
-
In the Category pane choose Session. In the Saved Sessions text box type in Neptune Tunnel and click Save. This will allow easy loading for next session.
-
At the bottom of the Session screen choose Open. When the session opens, you can right click the Putty icon in the top left of the window, go to Event Log, you will see:
[timestamp] Local port 8182 forwarding to mydbcluster.cluster-123456789012.eu-west-1.neptune.amazonaws.com:8182 -
In a browser go to : http://localhost:8182 you will receive a successful message, you can also go to http://localhost:8182/status to see status healthy and other information about the Neptune service (currently Https is not working, AWS Support confirmed there was a certificate issue and they would speak to development regarding it)
-
Open a command prompt locally as Admin, and run: "notepad c:\windows\system32\drivers\etc\hosts" , then add at the bottom add
127.0.0.1 YOUR_NEPTUNE_CLUSTER_ENDPOINT
this will make it think your localhost name is the cluster name which will get around cert issues, so that you can have ssl enabled. You can verify it's using the new localhost name by going to : https://YOUR_NEPTUNE_CLUSTER_ENDPOINT:8182/status in your browser -
On the Neptune Cluster under Databases, click on your database in the grid, then, Configuration tab, DB cluster parameter group, make sure sure the neptune_enforce_ssl is enabled.
DO NOT DO THIS FOR A PRODUCTION DATABASE...THIS IS NOT SECURE OR SAFE
Edit graphConf.js
const host = "YOUR_NEPTUNE_CLUSTER_ENDPOINT"
const SINGLE_COMMANDS_AND_NO_VARS = true;
Open the graphexp.html and make sure you change the protocol to "websocket secure" at the bottom of the screen