Boot2docker Mongodb

Bash script to start a MongoDB sharded cluster using docker on OS X (via boot2docker)
Alternatives To Boot2docker Mongodb
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Mall70,358
2 days ago38apache-2.0Java
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Netdata65,295
13 hours ago363gpl-3.0C
Monitor your servers, containers, and applications, in high-resolution and in real-time!
Spring Boot Examples29,175
3 months ago8Java
about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。
Mall Learning12,336
15 days ago27apache-2.0Java
mall学习教程,架构、业务、技术要点全方位解析。mall项目(50k+star)是一套电商系统,使用现阶段主流技术实现。涵盖了SpringBoot 2.3.0、MyBatis 3.4.6、Elasticsearch 7.6.2、RabbitMQ 3.7.15、Redis 5.0、MongoDB 4.2.5、Mysql5.7等技术,采用Docker容器化部署。
Reaction12,08120225 days ago40December 09, 2022109gpl-3.0JavaScript
Mailchimp Open Commerce is an API-first, headless commerce platform built using Node.js, React, GraphQL. Deployed via Docker and Kubernetes.
Mall Swarm10,654
a month ago41apache-2.0Java
mall-swarm是一套微服务商城系统,采用了 Spring Cloud 2021 & Alibaba、Spring Boot 2.7、Oauth2、MyBatis、Docker、Elasticsearch、Kubernetes等核心技术,同时提供了基于Vue的管理后台方便快速搭建系统。mall-swarm在电商业务的基础集成了注册中心、配置中心、监控中心、网关等系统功能。文档齐全,附带全套Spring Cloud教程。
Crawlab10,070
2 months ago1March 03, 201939bsd-3-clauseGo
Distributed web crawler admin platform for spiders management regardless of languages and frameworks. 分布式爬虫管理平台,支持任何语言和框架
Coolify8,989
14 hours ago27apache-2.0PHP
An open-source & self-hostable Heroku / Netlify alternative. Cloud version available here -> https://app.coolify.io
Node Express Mongoose Demo5,085312 days ago1January 18, 20163mitJavaScript
A simple demo app using node and mongodb for beginners (with docker)
Biodrop4,766
13 hours ago93mitJavaScript
Connect to your audience with a single link. Showcase the content you create and your projects in one place. Make it easier for people to find, follow and subscribe.
Alternatives To Boot2docker Mongodb
Select To Compare


Alternative Project Comparisons
Readme

boot2docker-mongodb

Join the chat at https://gitter.im/gianpaj/boot2docker-mongodb

Bash script to start a MongoDB sharded cluster using docker on OS X (via boot2docker). It uses IP addresses for container communication.

Inspired by Alex Komyagin's mongo-docker.

Using official MongoDB docker image.

Current setup:

  • 2 replica sets (3 data notes)
  • 3 config servers
  • 1 mongos node

Installation on Mac:

Install Homebrew

First, install Homebrew.

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Install Virtualbox

Install VirtualBox using Brew Cask.

brew update
brew tap phinze/homebrew-cask
brew install brew-cask
brew cask install virtualbox

Install boot2docker and docker-compose

Boot2docker is a small script that helps download and setup a minimal Linux VM that will be in charge of running docker daemon.

brew install boot2docker
boot2docker init
boot2docker up
brew install docker-compose

Check out the repository

git clone [email protected]:gianpaj/boot2docker-mongodb.git
cd boot2docker-mongodb

Setup Cluster

This will pull the official MongoDB image and setup a sharded cluster.

source setup.sh

Example output:

Writing /Users/gianfranco/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/gianfranco/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/gianfranco/.boot2docker/certs/boot2docker-vm/key.pem
Creating mongo_rs1_1...
Creating mongo_rs1_2...
Creating mongo_rs1_3...
Starting mongo_rs1_1...
Starting mongo_rs1_2...
Starting mongo_rs1_3...
Creating mongo_rs2_1...
Creating mongo_rs2_2...
Creating mongo_rs2_3...
Starting mongo_rs2_1...
Starting mongo_rs2_2...
Starting mongo_rs2_3...
Initiating replica set
{ "ok" : 1 }
Initiating replica set
{ "ok" : 1 }
Creating mongo_cfg_1...
Creating mongo_cfg_2...
Creating mongo_cfg_3...
Starting mongo_cfg_1...
Starting mongo_cfg_2...
Starting mongo_cfg_3...
Starting mongos...
{ "shardAdded" : "rs1", "ok" : 1 }
{ "shardAdded" : "rs2", "ok" : 1 }
{ "nInserted" : 1 }
{
	"raw" : {
		"rs2/172.17.0.57:27017,172.17.0.58:27017,172.17.0.59:27017" : {
			"createdCollectionAutomatically" : false,
			"numIndexesBefore" : 1,
			"numIndexesAfter" : 2,
			"ok" : 1,
			"$gleStats" : {
				"lastOpTime" : Timestamp(1427043270, 3),
				"electionId" : ObjectId("550ef3b7702605233a3b52af")
			}
		}
	},
	"ok" : 1
}
{ "ok" : 1 }
{ "collectionsharded" : "test.test", "ok" : 1 }
#####################################
MongoDB Cluster is now ready to use
Connect to the cluster via docker:
$ docker exec -it mongos mongo

Connect to the cluster via OS X:
$ mongo 192.168.59.103

Connect to the sharded cluster

You should now be able connect to the new sharded cluster via the mongos node:

$ mongo 192.168.59.103
MongoDB shell version: 3.0.0
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-03-22T16:54:19.591+0000 I CONTROL  ** WARNING: You are running this process as the root user, which is not recommended.
2015-03-22T16:54:19.592+0000 I CONTROL
mongos> sh.status()
--- Sharding Status ---
  sharding version: {
	"_id" : 1,
	"minCompatibleVersion" : 5,
	"currentVersion" : 6,
	"clusterId" : ObjectId("550ef3bc06152859f0406435")
}
  shards:
	{  "_id" : "rs1",  "host" : "rs1/172.17.0.54:27017,172.17.0.55:27017,172.17.0.56:27017" }
	{  "_id" : "rs2",  "host" : "rs2/172.17.0.57:27017,172.17.0.58:27017,172.17.0.59:27017" }
  balancer:
	Currently enabled:  yes
	Currently running:  no
	Failed balancer rounds in last 5 attempts:  0
	Migration Results for the last 24 hours:
		No recent migrations
  databases:
	{  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
	{  "_id" : "test",  "partitioned" : true,  "primary" : "rs2" }
		test.test
			shard key: { "_id" : "hashed" }
			chunks:
				rs2	1
			{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : rs2 Timestamp(1, 0)

List docker containers

$ docker ps
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                      NAMES
29ab8a7ace17        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          0.0.0.0:27017->27017/tcp   mongos
a285db10a9c9        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_cfg_3
ea6c65693796        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_cfg_2
7ff53954aa89        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_cfg_1
3abf28cbe965        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs2_2
4b6532f484f6        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs2_3
d885bfae4069        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs2_1
ede4197d5086        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs1_3
0c2cabc5a65b        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs1_2
f2e58d9b3201        mongo:latest        "/entrypoint.sh mong   3 hours ago         Up 3 hours          27017/tcp                  mongo_rs1_1

Auth

ln -s docker-compose.auth300.yml docker-compose.yml
ln Dockerfiles/30auth Dockerfile
docker build -t gianpaj/boot2docker_3.0.0 -f Dockerfile .

Built upon

Popular Docker Projects
Popular Mongodb Projects
Popular Virtualization Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Shell
Docker
Mongodb
Bash
Mongo
Virtualbox
Bash Script