mcrain 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcrain/container_controller.rb +9 -1
- data/lib/mcrain/riak.rb +15 -3
- data/lib/mcrain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a827b7fa0a1b8a568712e027c1378e0b1f9ef8a
|
4
|
+
data.tar.gz: 975971865b932bbbaace5fb3b6a1158b564d905b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eda8ede3198ff5cdd6804e32f5c1cbd2ed9729efd2f5ef5076f6447faf9290aa5fb37854c3c98153339eada33d917acb4f1d7cf42451ebbf0a1ace49c1cff3da
|
7
|
+
data.tar.gz: 2b4ca199e94c665359f1b027ed09d6c1e1af2a25f407f2a128534be6a7332731b68e01c2bb0df4f40db105676b95962c138f2cce3b6e51b01f2e915a0aae9ec8
|
@@ -68,8 +68,16 @@ module Mcrain
|
|
68
68
|
self
|
69
69
|
end
|
70
70
|
|
71
|
+
def info
|
72
|
+
container.json
|
73
|
+
end
|
74
|
+
|
75
|
+
def name
|
76
|
+
info["Name"] # .sub(/\A\//, '')
|
77
|
+
end
|
78
|
+
|
71
79
|
def ip
|
72
|
-
|
80
|
+
info["NetworkSettings"]["IPAddress"]
|
73
81
|
end
|
74
82
|
|
75
83
|
def ssh_uri
|
data/lib/mcrain/riak.rb
CHANGED
@@ -50,12 +50,12 @@ module Mcrain
|
|
50
50
|
r = super
|
51
51
|
r['HostConfig']['PortBindings']["8098/tcp"] = [{ 'HostPort' => http_port.to_s }]
|
52
52
|
envs = []
|
53
|
-
envs << "
|
53
|
+
envs << "DOCKER_RIAK_CLUSTER_SIZE=#{owner.cluster_size}"
|
54
54
|
envs << "DOCKER_RIAK_AUTOMATIC_CLUSTERING=#{owner.automatic_clustering ? 1 : 0}"
|
55
55
|
envs << "DOCKER_RIAK_BACKEND=#{owner.backend}"
|
56
56
|
r['Env'] = envs unless envs.empty?
|
57
57
|
if primary_node
|
58
|
-
r['HostConfig']['Links'] = ["#{primary_node.
|
58
|
+
r['HostConfig']['Links'] = ["#{primary_node.name}:seed"]
|
59
59
|
end
|
60
60
|
return r
|
61
61
|
end
|
@@ -142,7 +142,18 @@ module Mcrain
|
|
142
142
|
|
143
143
|
def setup
|
144
144
|
Boot2docker.setup_docker_options
|
145
|
-
nodes
|
145
|
+
# setup_nodes(nodes[0, 1]) # primary node
|
146
|
+
# setup_nodes(nodes[1..-1])
|
147
|
+
nodes.each do |node|
|
148
|
+
setup_nodes([node])
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
def setup_nodes(nodes)
|
153
|
+
return if nodes.empty?
|
154
|
+
containers = nodes.map(&:container)
|
155
|
+
containers.each(&:start!)
|
156
|
+
|
146
157
|
# http://basho.co.jp/riak-quick-start-with-docker/
|
147
158
|
#
|
148
159
|
# "Please wait approximately 30 seconds for the cluster to stabilize"
|
@@ -164,6 +175,7 @@ module Mcrain
|
|
164
175
|
raise msg
|
165
176
|
end
|
166
177
|
end
|
178
|
+
logger.info("container started: " << containers.map{|c| c.json}.join("\n"))
|
167
179
|
end
|
168
180
|
|
169
181
|
def teardown
|
data/lib/mcrain/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mcrain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logger_pipe
|