# Mongodb error connection

**URL:** <https://discourse.nodered.org/t/mongodb-error-connection/8246>\
**Category:** General\
**Created:** [21 February 2019 20:54 UTC](https://discourse.nodered.org/t/mongodb-error-connection/8246 "2019-02-21T20:54:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@nico](https://discourse.nodered.org/u/nico)\
**Post date:** [21 February 2019 20:54 UTC](https://discourse.nodered.org/t/mongodb-error-connection/8246/1 "2019-02-21T20:54:39Z")

</div>

hello,

I have 2 raspberry pi 3 on the same local network, with mongodb + mongoexpress + nodered, installed in the same way on each one.  
the first one is for 192.168.1.1, the second is 192.168.1.2, when I make requests from the first to the second using the node mongodb2 of the kind, mongodb: [//192.168.1.2](https://192.168.1.2): 27017 / db it works perfectly, by cons on the second to the first when I try a request on mongodb: [//192.168.1.1](https://192.168.1.1): 27017 / db, I have a message like: MongoError: failed to connect to server [192.168.1.1:27017] on first connect [MongoError: connect ECONNREFUSED 192.168.1.1:27017].  
I prescribe that the two databases work perfectly.  
I do not understand where the problem comes from.  
have you an idea about this?  
see you  
Nico

---

<div class="post-metadata">

**Author:** ![nico](https://avatars.discourse-cdn.com/v4/letter/n/b5a626/32.png) [@nico](https://discourse.nodered.org/u/nico)\
**Post date:** [23 February 2019 16:59 UTC](https://discourse.nodered.org/t/mongodb-error-connection/8246/2 "2019-02-23T16:59:49Z")

</div>

Hello, i find a way by myself, the trouble is in the setup of mongodb in 192.168.1.1, you must change in  
etc/mongodb.conf the value bind\_ip change to 0.0.0.0 and also port:27017.  
see you  
Nico
