Tag: mongodb

bash: How do I write a shell script to sftp a mongodump from a MongoDB Docker container inside a DigitalOcean droplet to backup the MongoDB database?

I’m running a MeteorJS webapp deployed with meteor-up on a DO droplet. I would like to have a .sh run from my local machine to get backups occasionally. Folders being able to have timestamps would be a plus. This is what I am trying to achieve with a single .sh file: on local machine: ssh […]

How to run mongo in kubernetes with authentication

I am new to kubernetes. In docker I can use the official mongo image and run docker run –name some-mongo -d mongo –auth And then connect to it and create a default db user. How can I pass –auth in a kube controller spec? Replication Controller # db-controller.yml apiVersion: v1 kind: ReplicationController metadata: labels: name: […]

Connect to a docker mongo instance from remote server

This should be really simple but I can’t find any answer I installed docker on a server I am running mongo on it docker run –name some-mongo -d mongo I have one user $ docker exec -it some-mongo mongo admin connecting to: admin > db.createUser({ user: ‘jsmith’, pwd: ‘some-initial-password’, roles: [ { role: “userAdminAnyDatabase”, db: […]

Scaling a two-tier MEAN application with Docker on AWS

So my current set-up is a Node.js application that serves up an Angular front-end, a second Node.js application that has Express and serves as an API, and a MongoDB instance. Simply, the client-side app talks to the back-end app and the back-end app talks to MongoDB. I was looking into how to Dockerize these applications […]

mongod doesn't stop (docker debian:wheezy)

I have the following Dockerfile: FROM debian:wheezy RUN apt-get update RUN apt-get install -y apt-utils RUN apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv EA312927 RUN echo “deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.2 main” | tee /etc/apt/sources.list.d/mongodb-org-3.2.list RUN apt-get update RUN apt-get install -y mongodb-org Then I build the image: docker build -t my/image . and try to start and stop […]

Connection error for MongoDb replica-set using docker-compose

I’m trying to connect to mongodb replica set running under 4 containers: 3 mongo as a cluster, and 1 to issue mongo commands to others. Here I don’t know how should I connect it to my application with a mongodb url. docker-compose.yml is mongo3: image: mongo:latest hostname: mongo3 expose: – “27017” – “28017” restart: always […]

Where mongoimport store the document in a Docker container

So I’m searching where the files are stored after this command mongoimport –db meteor –collection articles –type csv –headerline –file /data/seeds/articles.csv I’m using a Docker container from the image mongo:latest I thought it would be in the /data/db but there isn’t my db ‘meteor’ or my collection ‘articles’ so I think I’m not in the […]

Multiple commands for Mongo Docker image

I am attempting to script some setup for Mongo instances in a Docker compose file. I seems as if the second command never runs (which should initiate this container as a primary in a repl set). Here is my command: docker run -d mongo /bin/bash -c “mongod –replSet \”test\”; mongo –eval \”rs.initiate({_id:’test’,members:[{_id:0,host:’localhost:27017′}]})\”” When I then […]

Docker application upload on AWS elastic beanstalk fails

I am using docker images for running web-app on PHP and MongoDB. Docker container is running perfectly on my local machine (Windows10) but it is not updating on AWS Elastic Beanstalk. I have made a zipped file consist of run.sh, Dockerfile, and Dockerrun.aws.json which can be found from here. On AWS Elastic Beanstalk I am […]

How to create a new Mongodb in a Docker container upon startup?

Really simple Dockerfile: FROM mongo:3.2.10 #create DB directory RUN mkdir -p /data/db EXPOSE 27017 CMD [“mongod”] When I run the container I want to automatically create a DB called “CBDB”. I do not want to manually run the mongo shell, want the new DB to be created automatically. Thanks!

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.