0

I'm currenly learning about Kubernetes (and other DevOps related technologies) and decided to create a simple project - deploying and testing a MongoDB database using K8s.

I've uploaded all the code to my personal GitHub: https://github.com/MCAntunes/DevOpsTraining

I've tested everything in my local machine (Windows 10) to make sure everything worked before moving to GitHub actions, and it indeed works.

When I try to connect to the database and run a simple command using

mongo mongodb://ip:port --eval "db.adminCommand('listDatabases')"

I get the following error:

MongoDB shell version v4.4.6
connecting to: mongodb://172.17.0.3:30000/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 172.17.0.3:30000, connection attempt failed: SocketException: Error connecting to 172.17.0.3:30000 :: caused by :: Connection refused :

I already disabled authorization to make sure that it wasn't a problem.
I also added following command to allow connections from all IPs but it didn't solve the problem.

--bind_ip ::,0.0.0.0

I don't know what could be the problem, but I suspect something network related.
Is there something I could do to try to diagnose the problem?

Thanks in advance. If you need more information please don't hesitate to ask.

MAntunes
  • 71
  • 1
  • 4
  • Does this answer your question? [mongo - couldn't connect to server 127.0.0.1:27017](https://stackoverflow.com/questions/13312358/mongo-couldnt-connect-to-server-127-0-0-127017) – Pit Jul 09 '21 at 11:16

0 Answers0