Questions tagged mongodb

Explore the latest questions and answers asked by our top developers.

Can’t Connect Kotlin and MongoDB project with Docker

I can’t connect my kotlin/gradle project up with mongodb. I keep seeing an error INFO org.mongodb.driver.cluster – Exception in monitor thread while connecting to server mongo:27017 #10 90.53 com.mongodb.MongoSocketException: mongo: Name does not resolve hostName=mongo port=27017 Dockerfile FROM gradle:4.3.1-jdk8-alpine WORKDIR /app ADD –chown=gradle:gradle . /app USER root RUN apk update RUN apk add git […]

By Aaron Bidwell
Categorised as docker, docker-compose, gradle, mongodb Tagged , , ,

How do I create a named database when using mongodb in a container?

I spun up a container using docker-compose using a dev.env file which had MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD and MONGO_INITDB_DATABASE in it. database: image: mongo:5.0.5 ports: – 27017:27017 env_file: – ./server/dbconfig/dev.env Say I want the name of the database to be dbTest, it’s test by default. I thought this would have been as simple as setting MONGO_INITDB_DATABASE=dbTest and […]

By paracetamol
Categorised as docker, mongodb Tagged ,

connection <monitor> to timed out

I am getting connection time out error description: i am running node js api in docker container and mongodb is running on ec2 instnace with 3 node cluster and attached network load balancer and while running the nodejs api with npm the database is connecting and working fine and while when i ran the same […]

By Vamsi Krishna
Categorised as amazon-ec2, amazon-ecs, docker, mongodb, node.js Tagged , , , ,

Data are wiped at least once a day (docker instance)

My data is deleted every day. The mongo server run under docker, and i never encounter this issue on my local computer. On the docker side: The mongo setup is set to persistant data volumes: – mongodata:/data/db There is no rebuild of the mongo instance from docker (the wipe happen during the uptime) I found […]

By RockerOne
Categorised as docker, moleculer, mongodb Tagged , ,

Docker. Flask. Client + Server. Mongodb. [Errno 111] Connection refused

I am trying to build a docker application that contains a mongodb database, a server and a client. The client and server are implemented in python using Flask, pymongo and requests. However, when I try to test my infrastructure and ping the server from the client I get the following error: [Errno 111] Connection refused. […]

Getting "MongooseServerSelectionError: connect ECONNREFUSED" in Docker Compose

I am doing a REST API with Express and MongoDB. Everything works perfectly locally. I want to dockerize the database and the backend using Docker Compose. The Mongo Docker works perfectly, but the backend fails to connect to it. It keeps throwing me this error: /backend/node_modules/mongoose/lib/connection.js:797 const serverSelectionError = new ServerSelectionError(); ^ MongooseServerSelectionError: connect ECONNREFUSED […]

Cannot connect to mongo that’s inside docker inside WSL2

What’s wrong with my settings? Here’s my docker-compose.yml that I start with sudo docker-compose up -d which ends up like that: CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7fa1ebd185d3 mongo "docker-entrypoint.s…" 2 minutes ago Up 2 minutes>27017-27019/tcp mongodb version: "3.8" services: mongodb: image: mongo container_name: mongodb environment: – MONGO_INITDB_ROOT_USERNAME=root1234356asdas – MONGO_INITDB_ROOT_PASSWORD=324gdfgdfgasdas volumes: – […]

By Axelly
Categorised as docker, mongodb, wsl-2 Tagged , ,

How to restrict connections to dockerized MongoDB from other dockerized application in the same server and deny public access to 27017

I am using Orion Context Broker (in docker container) and I need it to connect with MongoDB (which is in its own docker container). At the same time I must deny all incoming traffic to 27017 from external sources, because after running the docker-compose the port 27017 is "exposed" to public. All of the above […]

How can I solve the R10 problem in Heroku with docker + mongo image?

I’m trying to deploy my mongo into Heroku. Error from logs of Heroku: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch Stopping process with SIGKILL Process exited with status 137 State changed from starting to crashed My dockerfile: FROM mongo:latest # VOLUME [ "/data/db" ] EXPOSE […]

By Sulti
Categorised as docker, dockerfile, heroku, mongodb Tagged , , ,

Run mongostore in container with python3 script returns exit 126

I am trying to use mongostore command to restore my database by giving gzip archive. Using the Python’ subprocess.check_output method shown as below: # … # … subprocess.check_output([‘docker’, ‘exec’, mongoContId, ‘mongostore’, ‘–gzip’, ‘archive=’ + targetWithFileName, ‘–db’, DB_NAME]) mongoContId: contain id of the container, that has obtained with a fuction. DB_NAME: constant name value of the […]

By Ekestfa
Categorised as docker, mongodb, python-3.x, subprocess Tagged , , ,
1 2 3 83

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us