forked from qubell-bazaar/component-solr-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomponent-solr-dev.yml
More file actions
300 lines (291 loc) · 12.4 KB
/
component-solr-dev.yml
File metadata and controls
300 lines (291 loc) · 12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
#### Solr Cloud wit Zookeeper ensemble ####
###### Input Configuration parameters. In this section you can set input configuration parameters which you will beable to change later in reconfiguration########
application:
configuration:
configuration.solr-version: "4.6.0" ### Solr dist version
configuration.solr-collections: ["testone"] ### Solr collections array. Can contain urls to collections archive
configuration.solr-shards-num: 2 ### Shard numbers
configuration.solr-loglevel: "FINE" ### Solr log level
configuration.solr-zookeeper-loglevel: "INFO"
configuration.clusterSize: 4 ### Solr hosts numbers. 4 hosts used for 2-shard configration
configuration.recipe-url: "https://s3.amazonaws.com/qubell-starter-kit-artifacts/qubell-bazaar/component-solr-dev-cookbooks-stable-3210e89.tar.gz"
configuration.app-port: 8080
compute-config.hardwareId: "m1.small" ###EC2 Instance type
compute-config.imageId: "ami-246ed34c"
compute-config.login: "ec2-user"
compute-config.locationId: "us-east-1"
# Binding section.
# Here we are bind main.workflow component on sumbmodules.
# This is a component binding section it mean interfaces in components [main.workflow, app]
# will be connected by pin names regardless of interface name
bindings:
- [ClusterHarvester, cluster.tomcat]
- [cluster.solr, zookeeper]
# Application Interfaces binding section.
# Here we describe a interfaces with pins and their bindings on component's interfaces.
# For binding using function bind(Component1#interface.pin, Component2#interface.pin)
interfaces:
configuration: ###Input values .That values can be changed after application launch.
"*": "bind(cluster.solr#input.*)"
clusterSize: "bind(cluster#configuration.quantity, ClusterHarvester#input.clusterSize)"
app-port: "bind(cluster.tomcat#configuration.app-port)"
compute-config:
"*": "bind(cluster.tomcat#compute-config.*, zookeeper#compute-config.*)"
app-meta:
application-pic: "bind(metadata#output.application-pic)"
solr-zoo: ### combined interface for actions/output pins
solr-urls: "bind(ClusterHarvester#result.app-uris)"
solr-zoo-nodes: "bind(zookeeper#zoo.zoo-urls)"
zoo-ui: "bind(zookeeper#zoo.zoo-ui)"
####### Components definitions ########
components:
metadata:
type: cobalt.common.Constants
interfaces:
output:
application-pic:
type: publish-signal(map<string, object>)
name: ""
configuration:
configuration.values:
output.application-pic:
large: "https://s3.amazonaws.com/qubell-images/solr.png"
small: "https://s3.amazonaws.com/qubell-images/solr.png"
small-height: 101
ClusterHarvester:
type: workflow.Instance
interfaces:
input:
clusterSize: configuration(int)
harvester-pic: configuration(map<string, object>)
tomcat:
app-uri:
type: consume-signal(list<string>)
name: Solr url
result:
app-uris: publish-signal(list<string>)
required: [tomcat]
configuration:
configuration.triggers:
tomcat.app-uri: update
configuration.propagateStatus: [update]
input.harvester-pic:
large: "https://dl.dropboxusercontent.com/u/250836/component-harvester.gif"
configuration.workflows:
update: &update
steps:
- waitPeers:
action: waitPeers
parameters:
interfaces:
tomcat: "{$.clusterSize}"
timeout:
10 minute
- get-signals:
action: getSignals
precedingPhases: [ waitPeers ]
parameters:
multi: true
output:
signals: result
return:
app-uris: { value: "{$.signals.tomcat..app-uri}" }
launch: *update
cluster:
type: composite.Scaler
bindings:
- [tomcat, solr]
components:
tomcat:
type: reference.Submodule
configuration:
__locator.application-id: "Application Server"
configuration.java-opts: "-Duser.timezone=UTC"
interfaces:
configuration:
app-port:
type: configuration(int)
name: Application port
java-opts: configuration(string)
recipe-url: configuration(string)
compute-config: &compute-config
imageId: configuration(string)
hardwareId: configuration(string)
locationId: configuration(string)
login: configuration(string)
compute:
networks: publish-signal(map<string, map<string, string>>)
exec: receive-command(string command, int timeout => string stdOut, string stdErr => string stdOut, string stdErr, int exitCode)
put-file: receive-command(string filename, bytes payload)
get-file: receive-command(string filename => bytes payload)
tomcat:
app-host:
type: publish-signal(string)
name: Application hosts
app-port:
type: publish-signal(int)
name: Application port
app-uri:
type: publish-signal(list<string>)
source:
java-opts: consume-signal(string)
lib-uri: consume-signal(list<string>)
context-nodes: consume-signal(object)
context-attrs: consume-signal(object)
uri: consume-signal(list<string>)
path: consume-signal(list<string>)
solr:
type: workflow.Instance ### http://docs.qubell.com/developer/workflow-instance.html
interfaces:
input: #### Contain pins with type: configuration().
solr-version:
type: configuration(string)
name: Solr version
solr-collections:
type: configuration(list<string>)
name: Solr collections
solr-loglevel:
type: configuration(string)
name: Solr log level
solr-zookeeper-loglevel:
type: configuration(string)
name: Zookeeper log level
solr-shards-num:
type: configuration(int)
name: No. Solr shards
recipe-url:
type: configuration(string)
name: Chef cookbooks
app-port:
type: configuration(int)
compute:
networks: consume-signal(map<string, map<string, string>>)
exec: send-command(string command, int timeout => string stdOut, string stdErr => string stdOut, string stdErr, int exitCode)
put-file: send-command(string filename, bytes payload)
get-file: send-command(string filename => bytes payload)
tomcat:
app-host:
type: consume-signal(string)
name: Application hosts
app-port:
type: consume-signal(int)
name: Application port
zoo:
zoo-nodes:
type: consume-signal(list<string>)
name: Zookeeper hosts (private)
result:
solr-url:
type: publish-signal(string)
name: Solr
solr-node:
type: publish-signal(string)
name: Solr hosts
context-attrs: publish-signal(object)
context-nodes: publish-signal(object)
uri: publish-signal(list<string>)
path: publish-signal(list<string>)
lib-uri: publish-signal(list<string>)
java-opts: publish-signal(string)
required: [zoo, compute]
configuration:
configuration.workflows:
launch:
steps:
- get-signals:
action: getSignals
output:
signals: result
- deploy-solr: ### Run recipe for extract Solr war
action: "chefrun"
phase: deploy-solr
precedingPhases: [ get-signals ]
parameters:
isSolo: true
roles: [ compute]
runList: [ "recipe[cookbook-qubell-solr]" ]
recipeUrl: "{$.recipe-url}"
jattrs:
cookbook-qubell-solr:
port: "{$.app-port}"
hostcontext: "solr"
version: "{$.solr-version}"
loglevel: "{$.solr-loglevel}"
zookeeper:
loglevel: "{$.solr-zookeeper-loglevel}"
output:
chefAttrs: chefState
- create-collections: ### Create Solr collections in Zookeeper
action: "chefrun"
phase: create-collections
precedingPhases: [ deploy-solr ]
parameters:
isSolo: true
roles: [ compute ]
runList: [ "recipe[cookbook-qubell-solr::create_collection]" ]
recipeUrl: "{$.recipe-url}"
jattrs:
cookbook-qubell-solr:
version: "{$.solr-version}"
port: "{$.app-port}"
hostcontext: "solr"
collection: "{$.solr-collections}"
zookeeper:
hosts: "{$.signals.zoo.zoo-nodes}"
return:
java-opts: { value: "-DnumShards={$.solr-shards-num} -Dlog4j.configuration=file:///opt/solr/webapps/log4j.properties" }
lib-uri: { value: "{$.chefAttrs['*'][0]['cookbook-qubell-solr']['lib_uri']}" }
uri: { value: ["file://{$.chefAttrs['*'][0]['cookbook-qubell-solr']['war_uri']}"]}
path: { value: ["/solr"]}
solr-node: { value: "{$.signals.compute.networks.public.ip}" }
solr-url: { value: "http://{$.signals.compute.networks.public.ip}:{$.app-port}/solr" }
context-attrs:
value:
"docBase": "{$.chefAttrs['*'][0]['cookbook-qubell-solr']['war_uri']}"
"debug": "5"
"crossContext": "true"
"privileged": "true"
"allowLinking": "true"
context-nodes:
value:
- Environment:
"name": "solr/home"
"type": "java.lang.String"
"value": "/opt/solr/cores"
"override": "true"
zookeeper:
type: reference.Submodule
configuration:
__locator.application-id: "Zookeeper"
configuration.exhibitor-port: 8090
configuration.clusterSize: 3
interfaces:
compute-config: *compute-config
configuration:
recipe-url:
type: configuration(string)
name: Cookbooks url
zookeeper-cli-port:
type: configuration(int)
name: Client port
zookeeper-elect-port:
type: configuration(int)
name: Election port
exhibitor-port:
type: configuration(int)
name: Exhibitors UI port
clusterSize:
type: configuration(int)
name: No. Zookeeper hosts
scale:
set-quantity: receive-command(int quantity)
zoo:
zoo-nodes:
type: publish-signal(list<string>)
name: Zookeeper hosts (private)
zoo-ui:
type: publish-signal(list<string>)
name: Exhibitiors UI
zoo-urls:
type: publish-signal(list<string>)
name: Zookeper Urls (private)