I have two computers: Ubuntu1 and Ubuntu2. Ubuntu1 runs MongoDB with database Sacred3. I want to run connect from U2 to U1 via ssh and store there my experiment results.
What I tried and failed: 1. I installed mongo DB, created sacred3, I have ssh key to it. I edited /etc/mongod.conf adding:
# network interfaces net: port: 27017 bindIp: 0.0.0.0
Then I enabled port forwarding with
ssh -fN -i ~/.ssh/sacred_key-pair.pem -L 6666:localhost:27017 [email protected] // (with proper ip)
so, as I undertstand, if I connect to my localhost:6666 it will be forwarded to 106.969.696.969:27017
So after that, I'm runnig an experiment with Sacred framework:
python exp1.py -m localhost:6666:sacred3
and this should write experiment to remote DB, HOWEVER i I get:
pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
which is driving me mad. please help!
X:host:Y) command suggests that yourlocalhot:6666is forwarded tolocalhost:27017, and not106.969.whatever:27017. If you want do set that up, you should have something like-L localhost:6666:106.969.696.969:27017. mongo is not listening on the loopback.