Tag: mongodb

docker mongodb replication on same server

I want to setup on my dev machine a mongodb replication, same machine running mongodb instances on docker. so i have docker containers running mongodb instances on them, working, fine and setup. // some images omitted $ docker ps -a>27017/tcp>27017/tcp>27017/tcp then, on my PRIMARY, i tried adding something PRIMARY> rs.add(“”) { “ok” […]

Mongo running in linux container, stop taking connection.

I am running MongoDB inside the Docker, a linux container. Based on this Dockerfile. I am using the latest mongo release, 2.6.4 installed on Ubuntu 14.04 64bits. I am able to start the mongod, I do have a /data/db folder in the container and the host machine ( even used as mounted folder, it is […]

Docker MongoDB error : Can't call something

I have Dockerized MongoDB and trying to access it from another container running on the same host. But i am getting the following error on the container: com.mongodb.MongoException$Network: can’t call something : / at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:227) at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305) at com.mongodb.DB.command(DB.java:160) at com.mongodb.DB.command(DB.java:183) at com.mongodb.DB.command(DB.java:144) at com.mongodb.DB.command(DB.java:195) at com.mmi.epg.utils.MongoDB.getDbVersion(MongoDB.java:117) at com.mmi.epg.utils.MongoDB.<init>(MongoDB.java:73) at com.mmi.epg.utils.MongoDB.getInstance(MongoDB.java:105) Caused by: java.io.EOFException at […]

Cannot create mongodb image on Docker

I’m trying to create mongodb container in Docker. First, create ubuntu container in interactive mode. $ sudo docker run -i -t ubuntu:12.04 /bin/bash And install mongodb $ export http_proxy=xxx.xxx.xxx.xxx:xxxx $ export https_proxy=xxx.xxx.xxx.xxx:xxxx $ echo ‘deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen’ | tee /etc/apt/sources.list.d/10gen.list $ apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10 $ apt-get update … Get:27 http://archive.ubuntu.com precise-security/universe […]

Yesod Persona authentication problems when using Dockerized MongoDB

We are developing an application using Yesod and MongoDB and we are having users authenticate using Mozilla Persona. However we have a development database that we use across development machines and also on our staging machine. Anytime development or testing data is added or removed from staging we synchronize it with the development machines using […]

Roles missing in mongodb

I am using Docker to add mongodb 2.6.5 to a host that already had 2.4.9 installed and I am sharing the data directory. When I run the 2.6.5 (in container) I get permission issues apparently due to changes in 2.6: http://docs.mongodb.org/manual/tutorial/add-user-to-database/ But when I try to add a user with role roleAdminAnyDatabase I get “No […]

replica set in MongoDB using docker, primary has error and stops being primary when another member is added to the set

I have two docker containers running a mongo instance each, they were initialized like this: docker run –name mongodb-shard-1-node-1 -d -v mongodb-shard-1-node-1:/data/db -p 27031:27017 mongo –replSet rs0 –smallfiles –oplogSize 128 when i do docker inspect mongodb-shard-1-node-1 it shows the ip docker run –name mongodb-shard-1-node-2 -d -v mongodb-shard-1-node-2:/data/db -p 27020:27017 mongo –replSet rs0 –smallfiles –oplogSize […]

Moving MongoDB dbpath to an AWS EBS device

I’m using CentOS 7 via AWS. I’d like to store MongoDB data on an attached EBS instead of the default /var/lib path. However, when I edit /etc/mongod.conf to point to a new dbpath, I’m getting a permission denied error. Permissions are set correctly to mongod.mongod on the dir. What gives?

cron job to start docker process and stop docker process

Say I have a mongodb docker process running after the below command: docker run –name my-mongo -d mongo Now I wish I could start this same docker process (same ID) everyday at 6am and stop it everyday at 6pm. Here is what I did in the cron: crontab -e 0 18 * * * /usr/bin/docker […]

Mongodb installation on Docker

I’ve been trying for a while now to install mongodb on my docker image in a variety of ways. I’ve tried using the official image by calling ‘docker pull mongo:latest’ but for some reason the terminal just hangs with no feedback from docker. I’ve also tried various ways to build it through Dockerfile but run […]

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