4.2.0 client for macos
connection with ssh server - ok
no connection with mongodb with ip and port on replica set.
this look like what not use ssh tunnel.
first try after run nosqlbooster:
{
"message" : "failed to connect to server [10.0.1.206:27017] on first connect [MongoError: connection 5 to 10.0.1.206:27017 timed out]",
"stack" : "MongoError: failed to connect to server [10.0.1.206:27017] on first connect [MongoError: connection 5 to 10.0.1.206:27017 timed out]" +
"at Pool.<anonymous> (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/mongodb-core/lib/topologies/server.js:336:35)" +
"at emitOne (events.js:96:13)" +
"at Pool.emit (events.js:191:7)" +
"at Connection.<anonymous> (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/mongodb-core/lib/connection/pool.js:280:12)" +
"at Object.onceWrapper (events.js:293:19)" +
"at emitTwo (events.js:106:13)" +
"at Connection.emit (events.js:194:7)" +
"at Socket.<anonymous> (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/mongodb-core/lib/connection/connection.js:197:10)" +
"at Object.onceWrapper (events.js:293:19)" +
"at emitNone (events.js:86:13)" +
"at Socket.emit (events.js:188:7)" +
"at Socket._onTimeout (net.js:351:8)" +
"at ontimeout (timers.js:386:14)" +
"at tryOnTimeout (timers.js:250:5)" +
"at Timer.listOnTimeout (timers.js:214:5)",
"name" : "MongoError"
}
second try and more:
{
"message" : "write EPIPE",
"stack" : "Error: write EPIPE" +
"at exports._errnoException (util.js:1050:11)" +
"at WriteWrap.afterWrite (net.js:813:14)",
"name" : "MongoError"
}
I studied this question, the answer is likely "the behavior is by design".
1. According to MongoDB Server selection spec.
Clients use the hostnames listed in the replica set config, not the seed list
This spec requires clients to connect to the hostnames listed in the ismaster response. Furthermore, if the response is from a primary, the client MUST remove all hostnames not listed. In this case, the client disconnects from "host_alias" and tries "host1" and "host2". (See updateRSFromPrimary.)Thus, replica set members must be reachable from the client by the hostnames listed in the replica set config.
2. In MongoDB Official Issue tracking system
Issue: Connect to ReplicaSet through SSH tunneling, the issue status is closed.
if you are willing to connect directly to a single known member of the set, you can do this by using one of the MongoClient constructors that takes a single ServerAddress instead of a List<ServerAddress>. These constructors make direct connections to servers and don't attempt any discovery of the other replica set members, which is what's getting you into trouble.
Another option, of course, is to set up a VPN, but I assume that's not an option for you.
3. MongoDB NodeJS driver
MongoDB Nodejs 2.1 or below uses the seed list, you can simply connect MongoDB Replicaset over SSH like this.
Run this sample with driver 2.1, I got "db connected".
But If run the same code with MongoDB Nodejs Driver 2.2 or plus. I got the following error:
connect error { MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoNetworkError: connect ETIMEDOUT ]
NoSQLBooster is depending on mongodb nodejs driver 2.2, we plan to upgrade to 3.0 once the official 3.0 driver is released.
I studied this question, the answer is likely "the behavior is by design".
1. According to MongoDB Server selection spec.
Clients use the hostnames listed in the replica set config, not the seed list
This spec requires clients to connect to the hostnames listed in the ismaster response. Furthermore, if the response is from a primary, the client MUST remove all hostnames not listed. In this case, the client disconnects from "host_alias" and tries "host1" and "host2". (See updateRSFromPrimary.)Thus, replica set members must be reachable from the client by the hostnames listed in the replica set config.
2. In MongoDB Official Issue tracking system
Issue: Connect to ReplicaSet through SSH tunneling, the issue status is closed.
if you are willing to connect directly to a single known member of the set, you can do this by using one of the MongoClient constructors that takes a single ServerAddress instead of a List<ServerAddress>. These constructors make direct connections to servers and don't attempt any discovery of the other replica set members, which is what's getting you into trouble.
Another option, of course, is to set up a VPN, but I assume that's not an option for you.
3. MongoDB NodeJS driver
MongoDB Nodejs 2.1 or below uses the seed list, you can simply connect MongoDB Replicaset over SSH like this.
Run this sample with driver 2.1, I got "db connected".
But If run the same code with MongoDB Nodejs Driver 2.2 or plus. I got the following error:
connect error { MongoError: failed to connect to server [127.0.0.1:27017] on first connect [MongoNetworkError: connect ETIMEDOUT ]
NoSQLBooster is depending on mongodb nodejs driver 2.2, we plan to upgrade to 3.0 once the official 3.0 driver is released.
Thank you for your feedback.
If possible, could you please give me an accessible test MongoDB URI and SSH connection to allow me to recall the issue quickly?
Thank you for your feedback.
If possible, could you please give me an accessible test MongoDB URI and SSH connection to allow me to recall the issue quickly?
We just released 3.5.2. The version upgrades the Node.js MongoDB driver to the latest. Could you please download and give it a try?
https://www.mongobooster.com/downloads
We just released 3.5.2. The version upgrades the Node.js MongoDB driver to the latest. Could you please download and give it a try?
https://www.mongobooster.com/downloads
I have the same issue to connect to MongoDB Atlas replica set via SSH tunnel.
My mongobooster version is v3.5.6 free edition and MongoDB is Version 3.4.4
you may apply a free account in MongoDB Atlas to reproduce.
Here is the error message:
I have the same issue to connect to MongoDB Atlas replica set via SSH tunnel.
My mongobooster version is v3.5.6 free edition and MongoDB is Version 3.4.4
you may apply a free account in MongoDB Atlas to reproduce.
Here is the error message:
I tried it with my test replica set+SSH key, It works well.
I hope to solve this issue, but can not reproduce it. If possible, could you please give me your test MongoDB replica set and test SSH key? One or two days is enough.
I tried it with my test replica set+SSH key, It works well.
I hope to solve this issue, but can not reproduce it. If possible, could you please give me your test MongoDB replica set and test SSH key? One or two days is enough.
in my problem 10.0.1.206:27017 is arbiter
in my problem 10.0.1.206:27017 is arbiter
Cannot Reproduce - its very easy
Cannot Reproduce - its very easy
i open vpn + ssh - and connection opened.
you can see - what connection go with out ssh to servers.
mongodb 3.4.4
i open vpn + ssh - and connection opened.
you can see - what connection go with out ssh to servers.
mongodb 3.4.4
I believe the problem is that after doing initial discovery using SSH tunnel, mongobooster tries to connect to individual replica set members directly (i.e. not using SSH tunnel). The expected behavior is that mongobooster will use SSH tunnel to connect to discovered replica set member.
This is based on netstat logs Pavel has provided:
To reproduce the problem w/o having remote subnet, you would need following:
I believe the problem is that after doing initial discovery using SSH tunnel, mongobooster tries to connect to individual replica set members directly (i.e. not using SSH tunnel). The expected behavior is that mongobooster will use SSH tunnel to connect to discovered replica set member.
This is based on netstat logs Pavel has provided:
To reproduce the problem w/o having remote subnet, you would need following:
Replies have been locked on this page!