I've got a sails.js application that I'm using sails-mongo on for my database. When I have the standard settings for sails-mongo in place, which appear like this the application boots right up:
mongodb: {
adapter: 'sails-mongo'
}
However, I've created a new database and have tried setting up the connection settings in connections.js
, but it is giving me Error: listen EADDRNOTAVAIL
, which appears to be a port conflict based on searching for this message. What I have tried is below; as you can see from the comments, I've tried a number of different hosts, and have also tried switching the ports.
mongodb: {
adapter: 'sails-mongo',
// host: '192.168.1.24',
// host: '127.0.0.1',
host: 'localhost',
port: 27017,
//port: 27021,
user: 'myUser',
password: 'myPassword',
database: 'myDb'
}
I've also run netstat -lptn
in the terminal, which shows the various processes after reading "How to Change Default Port" .
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:9050 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:17500 0.0.0.0:* LISTEN 2091/dropbox
tcp 0 0 127.0.0.1:17600 0.0.0.0:* LISTEN 2091/dropbox
tcp 0 0 127.0.0.1:17603 0.0.0.0:* LISTEN 2091/dropbox
tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN -
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN -
tcp6 0 0 ::1:631 :::* LISTEN -
tcp6 0 0 :::17500 :::* LISTEN
Thus, it seems there is a conflict; although sails-mongo
wants to run, something else is blocking it. However, when attempt to change to another port
or host
, my database
is no longer found.