如何使用 SSH 隧道从本地环境访问 Neptune 数据库? [英] How can I access the Neptune Database from my local environment using SSH tunnel?

查看:31
本文介绍了如何使用 SSH 隧道从本地环境访问 Neptune 数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有应用程序和网络负载平衡器.EC2 实例和 Neptune 在同一个 VPC 组中.我可以使用 ssh username@ 访问 EC2 实例,并且可以访问那里的 Gremlin 服务器并执行查询,但是如何从中建立隧道以便我可以在本地环境中使用它?如果您需要更多详细信息,请告诉我.

I have both application and network load balancer. EC2 instance and the Neptune are in the same VPC group. I am able to access the EC2 instance by using ssh username@ and can access the Gremlin server there and execute queries but how can I make a tunnel out of it so that I can use it from the local environment? Let me know if you need more detail.

推荐答案

您是否直接连接到 EC2,或者两者之间是否存在 NLB 或 ALB,并不是 100% 清楚的.如果您通过 SSH 从本地计算机直接连接到 EC2 以构建到 Neptune 的隧道,则可以使用诸如此类的命令.

It's not 100% clear if you are connecting directly to EC2 or whether there is a NLB or an ALB in between. If you are connecting from a local machine via SSH directly to EC2 to build a tunnel to Neptune, a command such as this will work.

ssh -i mycreds.pem ec2-user@ec2-xx-xx-xx-xx.compute-1.amazonaws.com -N -L 8182:my-neptune-cluster.us-east-1.neptune.amazonaws.com:818

为了解析 SSL 凭证,您可能需要在 hosts 文件中添加一行:

In order to get the SSL credentials to resolve you will likely need to add a line to your hosts file along the lines of:

127.0.0.1 localhost my-neptune-cluster.us-east-1.neptune.amazonaws.com

这篇关于如何使用 SSH 隧道从本地环境访问 Neptune 数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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