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
|
tosca_definitions_version: tosca_simple_yaml_1_0
description: >
This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash
and kibana each on a separate server with monitoring enabled for nodejs
server where a sample nodejs application is running. The rsyslog and collectd
are installed on a nodejs server.
imports:
- custom_types/paypalpizzastore_nodejs_app.yaml
- custom_types/elasticsearch.yaml
- custom_types/logstash.yaml
- custom_types/kibana.yaml
- custom_types/collectd.yaml
- custom_types/rsyslog.yaml
dsl_definitions:
host_capabilities: &host_capabilities
disk_size: 10 GB
num_cpus: { get_input: my_cpus }
mem_size: 4096 MB
os_capabilities: &os_capabilities
architecture: x86_64
type: Linux
distribution: Ubuntu
version: 14.04
topology_template:
inputs:
my_cpus:
type: integer
description: Number of CPUs for the server.
constraints:
- valid_values: [ 1, 2, 4, 8 ]
default: 1
github_url:
type: string
description: The URL to download nodejs.
default: http://github.com/paypal/rest-api-sample-app-nodejs.git
node_templates:
paypal_pizzastore:
type: tosca.nodes.WebApplication.PayPalPizzaStore
properties:
github_url: { get_input: github_url }
requirements:
- host: nodejs
- database_connection: mongo_db
interfaces:
Standard:
configure:
implementation: nodejs/config.sh
inputs:
github_url: { get_property: [ SELF, github_url ] }
mongodb_ip: { get_attribute: [mongo_server, private_address] }
start: nodejs/start.sh
nodejs:
type: tosca.nodes.WebServer
requirements:
- host: app_server
interfaces:
Standard:
create: nodejs/create.sh
mongo_db:
type: tosca.nodes.Database
requirements:
- host: mongo_dbms
interfaces:
Standard:
create: mongodb/create_database.sh
mongo_dbms:
type: tosca.nodes.DBMS
requirements:
- host: mongo_server
interfaces:
Standard:
create: mongodb/create.sh
configure:
implementation: mongodb/config.sh
inputs:
mongodb_ip: { get_attribute: [mongo_server, private_address] }
start: mongodb/start.sh
elasticsearch:
type: tosca.nodes.SoftwareComponent.Elasticsearch
requirements:
- host: elasticsearch_server
interfaces:
Standard:
create: elasticsearch/create.sh
start: elasticsearch/start.sh
logstash:
type: tosca.nodes.SoftwareComponent.Logstash
requirements:
- host: logstash_server
- search_endpoint:
node: elasticsearch
capability: search_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_source:
implementation: logstash/configure_elasticsearch.py
inputs:
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
interfaces:
Standard:
create: logstash/create.sh
start: logstash/start.sh
kibana:
type: tosca.nodes.SoftwareComponent.Kibana
requirements:
- host: kibana_server
- search_endpoint: elasticsearch
interfaces:
Standard:
create: kibana/create.sh
configure:
implementation: kibana/config.sh
inputs:
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
kibana_ip: { get_attribute: [kibana_server, private_address] }
start: kibana/start.sh
app_collectd:
type: tosca.nodes.SoftwareComponent.Collectd
requirements:
- host: app_server
- log_endpoint:
node: logstash
capability: log_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_target:
implementation: logstash/configure_collectd.py
interfaces:
Standard:
create: collectd/create.sh
configure:
implementation: collectd/config.py
inputs:
logstash_ip: { get_attribute: [logstash_server, private_address] }
start: collectd/start.sh
app_rsyslog:
type: tosca.nodes.SoftwareComponent.Rsyslog
requirements:
- host: app_server
- log_endpoint:
node: logstash
capability: log_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_target:
implementation: logstash/configure_rsyslog.py
interfaces:
Standard:
create: rsyslog/create.sh
configure:
implementation: rsyslog/config.sh
inputs:
logstash_ip: { get_attribute: [logstash_server, private_address] }
start: rsyslog/start.sh
app_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
mongo_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
elasticsearch_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
logstash_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
kibana_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
outputs:
nodejs_url:
description: URL for the nodejs server, http://<IP>:3000
value: { get_attribute: [ app_server, private_address ] }
mongodb_url:
description: URL for the mongodb server.
value: { get_attribute: [ mongo_server, private_address ] }
elasticsearch_url:
description: URL for the elasticsearch server.
value: { get_attribute: [ elasticsearch_server, private_address ] }
logstash_url:
description: URL for the logstash server.
value: { get_attribute: [ logstash_server, private_address ] }
kibana_url:
description: URL for the kibana server.
value: { get_attribute: [ kibana_server, private_address ] }
|