MongoError: failed to connect to server
Can't understand why:
MacBook-Pro:zenbot macbookpro$ ./reducer.sh
/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/lib/mongo_client.js:225
throw err
^
MongoError: failed to connect to server [localhost:27017] on first connect
at null.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:312:35)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at null.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:256:12)
at g (events.js:260:16)
at emitTwo (events.js:87:13)
at emit (events.js:172:7)
at Socket.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:160:49)
at Socket.g (events.js:260:16)
at emitOne (events.js:77:13)
I was try to reinstall all, but again same error.
it seems you don't have mongodb running.. what do you get if you type mongo in the terminal?
If mongo is on a different host (or in the case of docker, a different container) you may need to edit the config.js to specify the correct connection string.
if you are using docker replace this line
c.mongo_url = "mongodb://localhost:27017/zenbrain"
with
c.mongo_url = "mongodb://" + process.env.MONGODB_PORT_27017_TCP_ADDR + ":27017/zenbrain"
getting the same error... running this fine in a docker container but want to run it without Docker.
what is the solution?
@grigio @dwightmulcahy
Use mongod to start MongoDB.
Reference: https://docs.mongodb.com/manual/reference/program/mongod/