I want to access a remote mongodb with SSH tunnel, but booster always tries to connect to localhost?
Answered
I want to access a remote mongodb with SSH tunnel, I did "Test Connection", connection to SSH tunnel is OK, but then NoSQLBooster always tries to connect to localhost, like localhost:39707 or any other ports, while by the configuration it should connect to a remote host with port 27017 which I configured, what is wrong?
14:57:32.248 *** Starting "Connect to SSH Server" *** {"askForPassword":false,"authMode":2,"keyPath":"/Users/kitty/id_rsa","passphrase":"","port":24822,"server":"51.222.144.114","username":"sysop"} 14:57:32.485 *** Finished "Connect to SSH Server" 237 ms*** {"askForPassword":false,"authMode":2,"keyPath":"/Users/kitty/id_rsa","passphrase":"","port":24822,"server":"51.222.144.114","username":"sysop"} 14:57:32.486 *** Starting MongoClient.connect *** {"options":{"appname":"NoSQLBoosterV5_145315.759","autoReconnect":true,"keepAlive":60000,"minSize":0,"poolSize":0,"promoteLongs":false,"promoteValues":false,"reconnectTries":172800,"socketTimeoutMS":0,"sslValidate":false,"useNewUrlParser":false},"uri":"mongodb://root:t4aAlxffgM7A8@localhost:39707/alita?authSource=alita"} 14:57:33.521 *** Connect Error *** {"errorLabels":["TransientTransactionError"],"message":"connection 6 to localhost:39707 closed","name":"MongoNetworkError","stack":"MongoNetworkError: connection 6 to localhost:39707 closed\n at Socket.<anonymous> (/Applications/NoSQLBooster for MongoDB.app/Contents/Resources/app.asar/node_modules/mongodb-core/lib/connection/connection.js:276:9)\n at Object.onceWrapper (events.js:273:13)\n at Socket.emit (events.js:182:13)\n at TCP._handle.close [as _onclose] (net.js:596:12)"}
About SSH tunnel: Local forwarding is used to forward a port(e.g. 39707 random port) from the client machine to the server machine (port:27017). Basically, the SSH client listens for connections on a configured port (e.g. 39707 random port) , and when it receives a connection, it tunnels the connection to an SSH server. The server connects to a configurated destination port (port:27017), possibly on a different machine than the SSH server
1. Why Random port?
A: We use random unoccupied ports (_.random(30000, 60000)) to avoid conflicts with local services
Do you have the same problem with an external SSH tunnel? refer to : https://www.ssh.com/ssh/tunneling/example#sec-What-Is-SSH-Port-Forwarding-aka-SSH-Tunneling
About SSH tunnel: Local forwarding is used to forward a port(e.g. 39707 random port) from the client machine to the server machine (port:27017). Basically, the SSH client listens for connections on a configured port (e.g. 39707 random port) , and when it receives a connection, it tunnels the connection to an SSH server. The server connects to a configurated destination port (port:27017), possibly on a different machine than the SSH server
1. Why Random port?
A: We use random unoccupied ports (_.random(30000, 60000)) to avoid conflicts with local services
Do you have the same problem with an external SSH tunnel? refer to : https://www.ssh.com/ssh/tunneling/example#sec-What-Is-SSH-Port-Forwarding-aka-SSH-Tunneling
Replies have been locked on this page!