D
D
Dmitry Bashinsky2019-07-07 12:01:00
MongoDB
Dmitry Bashinsky, 2019-07-07 12:01:00

How to connect to MongoDB on the local network?

Hello. I decided to deploy my apishka locally - I made a server from a laptop.
Deployed the API, installed Mongu on the same computer and it all worked - hooray!
I connected like this: mongodb://localhost:27017/root
I want to connect to monge from another computer on the same network, but the connection fails due to a timeout.
mongodb://192.168.31.44:27017/root
I sort of allowed all IPs on the mongo side, opened ports 27017 on both computers for input and output, but it doesn’t connect :(

Screen
kTJq7XD.png

What should be checked in this case?
A couple more questions
1) My computer will be visible from the network, will someone else be able to connect to the monge? since I did not set login, password
2) I want to make DEV and PROD how to split mongo? Do different databases or something else?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill Kudryavtsev, 2019-07-07
@BashkaMen

By default the monga runs on 127.0.0.1. That is, you need to specify host 0.0.0.0 in the configuration, or the one you need.

D
Dimonchik, 2019-07-07
@dimonchik2013

the screen is wrong
, nmap + telnet is needed
1) like Monga has already begun to sculpt a login pass on the internetwork, no?
2) https://docs.mongodb.com/v3.4/core/master-slave/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question