Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

465
Visualizações
Connect to EC2 via MongoDB Compass Community

I have an EC2 instance (Ubuntu 14). I've defined port 27017 in its security group to be accessed from anywhere.

I'm trying to connect from my PC (Windows 10) to the EC2 instance, but getting the following error:

MongoDB not running on the provided host and port

which is not true since I've made sure that MongoDB is running.

These were the settings I specified:

enter image description here

I've also tried to use SSH (which is also defined in the sercurity group and works well through terminal), but got the following error:

Error creating SSH Tunnel: (SSH) Channel open failure: Connection refused

These were the settings I specified:

enter image description here

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Alon,
Checkpoints

  1. See if there is a need to change the bind_ip variable at the /etc/mongodb.conf file.
    By default, it is locked to localhost.
    Try setting the value to 0.0.0.0 or assign the IP that will be able to connect the DB to it.
  2. Port is allowed in security group attached to EC2 (You mentioned its done)
  3. Not using private IP to connect (I guess, you are using the right one as you connected through terminal)
  4. Rare case, OS firewall

I guess point 1 should do the trick. Rest points for future reference

[Update 1]
Doc link for bindIp
https://docs.mongodb.com/manual/reference/configuration-options/#net-options

over 4 years ago · Santiago Trujillo Relatório

0

I am putting this as an answer although it is meant as a comment to the answer by raevilman above but I do not have the necessary reputation to post comments yet.

If you set the bind_ip variable to 0.0.0.0 as mentioned, MongoDB accepts connections from all IP addresses. This might be a security risk if you do not use access control.

On the other hand, if I am not wrong, the idea of a SSH tunnel is for that, in this case MongoDB, the entering connection comes from localhost so no change in the configuration should be necessary.

That said, I came here because I could not connect either. I got the error 'Error creating SSH Tunnel: Timed out while waiting for forwardOut'.

In my case the solution was to put 'localhost' in the hostname field at the top instead of the host IP.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda