SSH Tunnelier Rock Mongo - connect to EC2 from win7

邮差的信 提交于 2020-01-06 08:09:17

问题


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

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 ++;

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'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";

回答1:


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:

  • http://blog.balaji-dutt.name/2008/11/17/things-i-like-bitvise-tunnelier/
  • http://theillustratednetwork.mvps.org/Ssh/Configure-Tunnelier.html

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

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.



来源:https://stackoverflow.com/questions/12182552/ssh-tunnelier-rock-mongo-connect-to-ec2-from-win7

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