Connect to Neptune on AWS from local machine

别说谁变了你拦得住时间么 提交于 2019-11-29 07:02:52

Neptune does not support public endpoints (endpoints that are accessible from outside the VPC). However, there are few architectural options using which you can access your Neptune instance outside your VPC. All of them have the same theme: setup a proxy (EC2 machine, or ALB, or something similar, or a combination of these) that resides inside your VPC, and make that proxy accessible from outside your VPC.

It seems like you want to talk to your instance purely for development purposes. The easiest option for that would be to spin up an ALB, and create a target group that points to your instance's IP.

Brief Steps (These are intentionally not in detail, please refer to AWS Docs for detailed instructions):

  1. dig +short <your cluster endpoint> This would give you the current master's IP address.

  2. Create an ALB (See AWS Docs on how to do this).

  3. Make your ALB's target group point to the IP Address obtained for step #1. By the end of this step, you should have an ALB listening on PORT-A, that would forward requests to IP:PORT, where IP is your database IP (from Step 1) and PORT is your database port (default is 8182).
  4. Create a security group that allows inbound traffic from everywhere. i.e. Inbound TCP rule for 0.0.0.0 on PORT-A.
  5. Attach the security group to your ALB

Now from your developer boxes, you can connect to your ALB endpoint at PORT-A, which would internally forward the request to your Neptune instance.

Do checkout ALB docs for details around how you can create it and the concepts around it. If you need me to elaborate any of the steps, feel free to ask.

NOTE: This is not a recommended solution for a production setup. IP's used by Neptune instances are bound to change with failovers and host replacements. Use this solution only for testing purposes. If you want a similar setup for production, feel free to ask a question and we can discuss options.

Hi you can connect NeptuneDB by using gremlin console at your local machine. USE THIS LINK to setup your local gremlin server, it works for me gremlin 3.3.2 version Only you have to update the remote.yaml as per your url and port

Neptune doesn't allow you to connect to the db instance from your local machine. You can only connect to Neptune via an EC2 inside the same VPC as Neptune (aws documentation).

Steps to access neptune from local:

  1. Create an EC2 instance in the same VPC as your neptune cluster.
  2. Allow EC2 to be accessed by your IP.
  3. Download apache gremlin console in the EC2 instance.
  4. Unzip the console folder and open the neptune-remote.yaml file inside.
  5. Change the host name in yaml file to your neptune cluster endpoint.
  6. Run gremlin.sh file inside the bin folder of apache gremlin console.
  7. You are now at gremlin console. Remote connect to your neptune cluster using the following command- :remote connect tinkerpop.server conf/neptune-remote.yaml
  8. use command :remote console to remotely access your neptune cluster console.

All gremlin commands will now run directly on your neptune graph.

AWS documentation for steps 3-8.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!