SSH Tunnelier Rock Mongo - 从 win7 连接到 EC2 [英] SSH Tunnelier Rock Mongo - connect to EC2 from win7

查看:49
本文介绍了SSH Tunnelier Rock Mongo - 从 win7 连接到 EC2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过 SSH 隧道连接到我的 EC2 实例,以便我可以使用 Rock Mongo 作为我的 dB 客户端.
我已经在 AWS 上测试了 mongodb 并且它似乎工作正常,现在如果我只能使用客户端进行连接.

这是我在 Tunnelier 中的设置

I am trying to SSH tunnel into my EC2 instance so that i can use Rock Mongo as my dB client.
I've tested the mongodb on AWS and it seems to be working fine, now if i could only connect using the client.

Here are my settings from Tunnelier

摘自 Rock Mongo 的 config.php

an excerpt from Rock Mongo's config.php

$MONGO["servers"][$i]["mongo_name"] = "AWS";
$MONGO["servers"][$i]["mongo_host"] = "127.0.0.1:3000";
$MONGO["servers"][$i]["mongo_port"] = "27018";
$MONGO["servers"][$i]["control_users"]["admin"] = "admin";
$i ++;

并从我的 EC2 实例的命令行执行

and from command line for my EC2 instance i did

mongod --port 27018


但是连接没有发生,我收到错误消息


However the connection does not happen and i get an error message of

Unable to connect MongoDB, please check your configurations. MongoDB said:failed to get host from :27018 of 127.0.0.1:3000:27018.

问题这是正确的方法还是我应该使用不同的方法?

Question is this the correct way of going about it or should i use a different method?



这里是修复,以防有人遇到类似问题



Here's the fix incase anyone has a similar problem

rockmongo 的 config.php

rockmongo's config.php

$MONGO["servers"][$i]["mongo_name"] = "AWS";
$MONGO["servers"][$i]["mongo_host"] = "127.0.0.1";
$MONGO["servers"][$i]["mongo_port"] = "3306";
$MONGO["servers"][$i]["control_users"]["admin"] = "admin";

推荐答案

我不熟悉 Tunnelier,但看起来您正在配置 HTTP 代理而不是实际的 SSH 端口转发.这些在隧道功能列表中有所区别.以下文章还提供了一些 Tunnelier 界面的屏幕截图,并附有评论,可能会为您指明正确的方向:

I have no familiarity with Tunnelier, but it looks like you're configuring an HTTP proxy instead of actual SSH port forwarding. These are distinguished in the Tunnelier feature list. The following articles also have some screenshots of the Tunnelier interface with commentary that might point you in the right direction:

我相信 C2S 或 S2C 标签是您应该研究的内容.

I believe the C2S or S2C tabs are what you should be looking into.

此外,您在 RockMongo 的配置中指定 127.0.0.1:3000 作为主机名,然后还提供 27018 作为端口.RockMongo 会将这些选项连接到 Mongo 的连接字符串中,这不是您想要的.如果您正在设置 SSH 端口转发,您的主机和端口可能会指向您的本地主机.Mongo 在 AWS 内运行的端口无关紧要,因为您在 AWS 之外的客户端只关心自己的 SSH 隧道一侧.

Also, you're specifying 127.0.0.1:3000 as the hostname in RockMongo's configuration, and then also providing 27018 as the port. RockMongo will concatenate those options into a connection string for Mongo, which isn't what you want. If you're setting up SSH port forwarding, your host and port will likely point to your local host. The port that Mongo is running on within AWS is irrelevant, as your client outside of AWS only cares about its own side of the SSH tunnel.

这篇关于SSH Tunnelier Rock Mongo - 从 win7 连接到 EC2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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