skip to Main Content

Can't connect to MongoDB Replica Set in Docker

I am attempting to run a MongoDB cluster locally to test transactions. I've leveraged the Bitnami docker-compose file version: '2' services: mongodb-primary: image: 'bitnami/mongodb:latest' environment: - MONGODB_ADVERTISED_HOSTNAME=mongodb-primary - MONGODB_REPLICA_SET_MODE=primary - MONGODB_ROOT_PASSWORD=password123 - MONGODB_REPLICA_SET_KEY=replicasetkey123 ports: - 27017:27017 volumes: - 'mongodb_master_data:/bitnami' mongodb-secondary:…

VIEW QUESTION

Mongodb – $ mongosh gives MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017

I'm getting MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 when trying to start mongo locally with $ mongosh. $ mongosh Current Mongosh Log ID: 636addb4**************** Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&appName=mongosh+1.5.4 MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017 Some details: I killed some process at some point to try…

VIEW QUESTION
Back To Top
Search