Skip to content

Commit

Permalink
mongodb 镜像名称调整
Browse files Browse the repository at this point in the history
  • Loading branch information
supermy committed Apr 9, 2015
1 parent 2eb2185 commit 41949b7
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion mymongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ https://github.com/brianfrankcooper/YCSB/tree/master/mongodb
> fig logs flume1
>
> mongo 192.168.59.103:27017
> show collections
> show collections
> db.events.find()
>
> ## END
Expand Down
11 changes: 10 additions & 1 deletion mymongodb/base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mydebian_base
FROM jamesmo/debian:7

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
Expand All @@ -10,6 +10,15 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*


# grab gosu for easy step-down from root
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu


# gpg: key 7F0CEB10: public key "Richard Kreuter <[email protected]>" imported
RUN apt-key adv --keyserver pool.sks-keyservers.net --recv-keys 492EAFE8CD016A07919F1D2B9ECBEC467F0CEB10
RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
Expand Down
10 changes: 9 additions & 1 deletion mymongodb/base/Dockerfile-2.65
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mydebian_base:latest
FROM jamesmo/debian:7

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
Expand All @@ -10,6 +10,14 @@ RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
#RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/download/1.1/gosu' \
# && chmod +x /usr/local/bin/gosu

# grab gosu for easy step-down from root
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
&& gpg --verify /usr/local/bin/gosu.asc \
&& rm /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu

RUN gpg --keyserver pgp.mit.edu --recv-keys DFFA3DCF326E302C4787673A01C4E7FAAAB2461C

ENV MONGO_VERSION 2.6.5
Expand Down
2 changes: 1 addition & 1 deletion mymongodb/base/Dockerfile-3.0.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mydebian_base
FROM jamesmo/debian:7

# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb
Expand Down
1 change: 1 addition & 0 deletions mymongodb/base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker build -t jamesmo/mongodb:3.0.1 .
2 changes: 1 addition & 1 deletion mymongodb/client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM base_mongo:latest
FROM jamesmo/mongodb:3.0.1

EXPOSE 27017
ENTRYPOINT ["mongos"]
24 changes: 12 additions & 12 deletions mymongodb/fig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
##集群的复制集1
##--noprealloc 生产机发布的时候去掉此选项
rs11:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs1 --rest --httpinterface
ports:
- "27018:27017"
Expand All @@ -68,7 +68,7 @@ rs11:
# - data11

rs12:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs1 --rest --httpinterface
ports:
- "27017"
Expand All @@ -81,7 +81,7 @@ rs12:
# - data12

rs13:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs1 --rest --httpinterface
ports:
- "27017"
Expand All @@ -95,7 +95,7 @@ rs13:

###集群的复制集2
rs21:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs2 --rest --httpinterface
ports:
- "27019:27017"
Expand All @@ -108,7 +108,7 @@ rs21:
# - data21

rs22:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs2 --rest --httpinterface
ports:
- "27017"
Expand All @@ -121,7 +121,7 @@ rs22:
# - data22

rs23:
image: base_mongo
image: jamesmo/mongodb:3.0.1
command: mongod --storageEngine=wiredTiger --smallfiles --replSet rs2 --rest --httpinterface
ports:
- "27017"
Expand All @@ -138,7 +138,7 @@ rs23:
##docker run --name cfg2 -P -d mydev/mongodb --smallfiles --configsvr --dbpath /data/db --port 27017
##docker run --name cfg3 -P -d mydev/mongodb --smallfiles --configsvr --dbpath /data/db --port 27017
cfg1:
image: base_mongo
image: jamesmo/mongodb:3.0.1
hostname: cfg1
command: mongod --storageEngine=wiredTiger --smallfiles --configsvr --dbpath /data/db --port 27017
ports:
Expand All @@ -147,7 +147,7 @@ cfg1:
# - datacfg1

cfg2:
image: base_mongo
image: jamesmo/mongodb:3.0.1
hostname: cfg2
command: mongod --storageEngine=wiredTiger --smallfiles --configsvr --dbpath /data/db --port 27017
ports:
Expand All @@ -156,7 +156,7 @@ cfg2:
# - datacfg2

cfg3:
image: base_mongo
image: jamesmo/mongodb:3.0.1
hostname: cfg3
command: mongod --storageEngine=wiredTiger --smallfiles --configsvr --dbpath /data/db --port 27017
ports:
Expand All @@ -168,7 +168,7 @@ cfg3:
###创建一个路由
##docker run --name mongos1 -P -d mydev/mongos --configdb 172.17.0.8:27017,172.17.0.9:27017,172.17.0.10:27017 --port 27017
route1:
image: base_mongo
image: jamesmo/mongodb:3.0.1
hostname: route1
command: mongos --configdb cfg1:27017,cfg2:27017,cfg3:27017 --port 27017
links:
Expand All @@ -192,7 +192,7 @@ route1:
#mongo 127.0.0.1:3003/test –quiet test.js

#dbinit1:
# image: base_mongo
# image: jamesmo/mongodb:3.0.1
# entrypoint: /bin/bash
# volumes:
# - .:/host
Expand Down Expand Up @@ -223,7 +223,7 @@ route1:
# - db:mysql

flume1:
image: myflume_base:latest
image: jamesmo/myflume:latest
hostname: flume1
environment:
FLUME_AGENT_NAME: agent2
Expand Down
2 changes: 1 addition & 1 deletion mymongodb/initdbi-1.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
printjson(1);
config={_id: 'rs1', members:[{_id: 0,host:'172.17.0.32:27017'},{_id:1,host:'172.17.0.30:27017'},{_id:2,host:'172.17.0.31:27017'}]}
config={_id: 'rs1', members:[{_id: 0,host:'172.17.1.9:27017'},{_id:1,host:'172.17.1.5:27017'},{_id:2,host:'172.17.1.7:27017'}]}
rs.initiate(config);
2 changes: 1 addition & 1 deletion mymongodb/initdbi-1.jsbak
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
printjson(1);
config={_id: 'rs1', members:[{_id: 0,host:'172.17.0.32:27017'},{_id:1,host:'172.17.0.30:27017'},{_id:2,host:'rs13:27017'}]}
config={_id: 'rs1', members:[{_id: 0,host:'172.17.1.9:27017'},{_id:1,host:'172.17.1.5:27017'},{_id:2,host:'rs13:27017'}]}
rs.initiate(config);
2 changes: 1 addition & 1 deletion mymongodb/initdbi-2.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
printjson(1);
config={_id: 'rs2', members:[{_id: 0,host:'172.17.0.27:27017'},{_id:1,host:'172.17.0.28:27017'},{_id:2,host:'172.17.0.29:27017'}]}
config={_id: 'rs2', members:[{_id: 0,host:'172.17.0.255:27017'},{_id:1,host:'172.17.1.1:27017'},{_id:2,host:'172.17.1.3:27017'}]}
rs.initiate(config);
2 changes: 1 addition & 1 deletion mymongodb/initdbi-2.jsbak
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
printjson(1);
config={_id: 'rs1', members:[{_id: 0,host:'172.17.0.27:27017'},{_id:1,host:'172.17.0.28:27017'},{_id:2,host:'172.17.0.29:27017'}]}
config={_id: 'rs1', members:[{_id: 0,host:'172.17.0.255:27017'},{_id:1,host:'172.17.1.1:27017'},{_id:2,host:'172.17.1.3:27017'}]}
rs.initiate(config);
4 changes: 2 additions & 2 deletions mymongodb/initdbi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
printjson(1);
sh.addShard("rs1/172.17.0.32:27017");
sh.addShard("rs2/172.17.0.27:27017");
sh.addShard("rs1/172.17.1.9:27017");
sh.addShard("rs2/172.17.0.255:27017");
sh.status();

db.runCommand( { listshards : 1 } );
Expand Down
2 changes: 1 addition & 1 deletion mymongodb/initdbi.jsbak
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
printjson(1);
sh.addShard("rs1/172.17.0.32:27017");
sh.addShard("rs1/172.17.1.9:27017");
sh.addShard("rs2/rs21:27017");
sh.status();

Expand Down
2 changes: 1 addition & 1 deletion mymongodb/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM base_mongo:latest
FROM jamesmo/mongodb:3.0.1

ENTRYPOINT ["mongod"]

0 comments on commit 41949b7

Please sign in to comment.