1

I am trying to import data to my mongodb sevrer that is hosted on the cloud.

I run the following command from a linux server that is inside a corporate firewall:

mongoimport --host myhost:10081 --db mydb -u myusr -p mypass --collection imptest --file test.dat --drop --stopOnError

The import starts running, connects to the remote mongod successfully, creates one record of data (checked my db) and then simply hangs forever with no error message.

I am quite sure that this happens due to some firewall settings which block communications back from the mongo server - when I do the same thing from outside the firewall it works perfectly. Can I make mongoimport work with more optimistic WriteConcern, and not wait for acks? Or better yet, how can I find out which port being blocked is causing me the trouble?

4

1 に答える 1

1

SSHの22のように、最も確実に開いているポートがいくつかあると思います。ファイアウォール内からクラウドベースのサーバーへの SSH トンネルの設定を試すことができます。次に、SSH トンネルを介して mongoDB ポートで接続を転送する必要があります。

于 2013-02-05T20:14:53.720 に答える