continuent-tools-core 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tungsten/exec.rb +13 -0
- data/lib/tungsten/install.rb +39 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b7b64099ff0f37bfcbaa4afa998993a4e023b74
|
4
|
+
data.tar.gz: 58ebccaa84312b4a8e4f2b1f7365c44c7fa9d5f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bdffb22ff4b6152d423afbcbbfbd8315196e23c9f90a6eec80425d13976e0a42bdfe0bdbd7a4ec883ed3f2dc5e7c6d177a8fcd5064170cb47e46db794caf24
|
7
|
+
data.tar.gz: 9b6b04384b36919462ab7e5a4a455f58f2e1442419492a1ae05ca3c0acb9350f1a76ff063769e818c1f750164f5173506ace560f9308362dec10e20fe5221708
|
data/lib/tungsten/exec.rb
CHANGED
@@ -238,6 +238,19 @@ class TungstenUtil
|
|
238
238
|
|
239
239
|
return
|
240
240
|
end
|
241
|
+
|
242
|
+
# A wrapper for running another Tungsten script. This will automatically
|
243
|
+
# forward messages to the console and add any TungstenScript options to
|
244
|
+
# the command.
|
245
|
+
def tungsten_cmd_result(command)
|
246
|
+
original_fwd_state = forward_cmd_results?()
|
247
|
+
begin
|
248
|
+
forward_cmd_results?(true)
|
249
|
+
return cmd_result("#{command} #{get_tungsten_command_options()}")
|
250
|
+
ensure
|
251
|
+
forward_cmd_results?(original_fwd_state)
|
252
|
+
end
|
253
|
+
end
|
241
254
|
|
242
255
|
# Run a standard check to see if SSH connectivity to the host works
|
243
256
|
def test_ssh(host, user)
|
data/lib/tungsten/install.rb
CHANGED
@@ -52,10 +52,17 @@ class TungstenInstall
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
# Path to the install directory for Continuent Tungsten. This will include
|
56
|
+
# all previous releases and a symlink to the current running version.
|
55
57
|
def root
|
56
58
|
@root
|
57
59
|
end
|
58
60
|
|
61
|
+
# Path to the current running version of Continuent Tungsten.
|
62
|
+
def base_path
|
63
|
+
"#{@root}/#{CURRENT_RELEASE_DIRECTORY}"
|
64
|
+
end
|
65
|
+
|
59
66
|
def hostname
|
60
67
|
setting("host_name")
|
61
68
|
end
|
@@ -79,7 +86,12 @@ class TungstenInstall
|
|
79
86
|
if is_manager?()
|
80
87
|
setting("dataservice_name")
|
81
88
|
elsif is_replicator?()
|
82
|
-
|
89
|
+
begin
|
90
|
+
local_services = TU.cmd_result("egrep -l \"^replicator.service.type=local\" #{@root}/#{CURRENT_RELEASE_DIRECTORY}/tungsten-replicator/conf/static*").split("\n")
|
91
|
+
rescue
|
92
|
+
local_services = []
|
93
|
+
end
|
94
|
+
|
83
95
|
if local_services.size() == 0
|
84
96
|
dataservices().get(0)
|
85
97
|
else
|
@@ -91,7 +103,11 @@ class TungstenInstall
|
|
91
103
|
end
|
92
104
|
|
93
105
|
def replication_services
|
94
|
-
|
106
|
+
begin
|
107
|
+
TU.cmd_result("egrep \"^service.name\" #{@root}/#{CURRENT_RELEASE_DIRECTORY}/tungsten-replicator/conf/static-* | awk -F \"=\" '{print $2}'").split("\n")
|
108
|
+
rescue
|
109
|
+
[]
|
110
|
+
end
|
95
111
|
end
|
96
112
|
|
97
113
|
def tpm
|
@@ -141,19 +157,37 @@ class TungstenInstall
|
|
141
157
|
if third == nil
|
142
158
|
raise "Unable to create setting key for #{first}.#{second}"
|
143
159
|
end
|
144
|
-
|
160
|
+
|
161
|
+
service_aliases = setting(setting_key(HOSTS, "deployment_dataservice_aliases"))
|
162
|
+
unless service_aliases.has_key?(second)
|
163
|
+
raise "Unable to find a configuration alias for the #{second} service"
|
164
|
+
end
|
165
|
+
|
166
|
+
"#{first}.#{TU.to_identifier(service_aliases[second])}.#{third}"
|
145
167
|
elsif first == HOSTS
|
146
168
|
"#{first}.#{TU.to_identifier(hostname())}.#{second}"
|
147
169
|
elsif first == MANAGERS
|
148
170
|
if third == nil
|
149
171
|
raise "Unable to create setting key for #{first}.#{second}"
|
150
172
|
end
|
151
|
-
|
173
|
+
|
174
|
+
service_aliases = setting(setting_key(HOSTS, "deployment_dataservice_aliases"))
|
175
|
+
unless service_aliases.has_key?(second)
|
176
|
+
raise "Unable to find a configuration alias for the #{second} service"
|
177
|
+
end
|
178
|
+
|
179
|
+
"#{first}.#{TU.to_identifier(service_aliases[second])}_#{TU.to_identifier(hostname())}.#{third}"
|
152
180
|
elsif first == REPL_SERVICES
|
153
181
|
if third == nil
|
154
182
|
raise "Unable to create setting key for #{first}.#{second}"
|
155
183
|
end
|
156
|
-
|
184
|
+
|
185
|
+
service_aliases = setting(setting_key(HOSTS, "deployment_dataservice_aliases"))
|
186
|
+
unless service_aliases.has_key?(second)
|
187
|
+
raise "Unable to find a configuration alias for the #{second} service"
|
188
|
+
end
|
189
|
+
|
190
|
+
"#{first}.#{TU.to_identifier(service_aliases[second])}_#{TU.to_identifier(hostname())}.#{third}"
|
157
191
|
else
|
158
192
|
"#{first}.#{TU.to_identifier(hostname())}.#{second}"
|
159
193
|
end
|