
Change the file structure to make appropriate for stand alone parser. Change-Id: I6d5259b61b1cd82949262fee4930fa66703ad036
229 lines
7.2 KiB
YAML
229 lines
7.2 KiB
YAML
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:
|
|
- paypalpizzastore_nodejs_app.yaml
|
|
- elasticsearch.yaml
|
|
- logstash.yaml
|
|
- kibana.yaml
|
|
- collectd.yaml
|
|
- rsyslog.yaml
|
|
|
|
dsl_definitions:
|
|
host_capabilities: &host_capabilities
|
|
# container properties (flavor)
|
|
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 ]
|
|
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:
|
|
node: nodejs
|
|
- database_connection:
|
|
node: mongo_db
|
|
interfaces:
|
|
Standard:
|
|
configure:
|
|
implementation: ../Scripts/nodejs/config.sh
|
|
inputs:
|
|
github_url: http://github.com/paypal/rest-api-sample-app-nodejs.git
|
|
mongodb_ip: { get_attribute: [mongo_server, private_address] }
|
|
start: ../Scripts/nodejs/start.sh
|
|
nodejs:
|
|
type: tosca.nodes.WebServer
|
|
requirements:
|
|
- host:
|
|
node: app_server
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/nodejs/create.sh
|
|
mongo_db:
|
|
type: tosca.nodes.Database
|
|
requirements:
|
|
- host:
|
|
node: mongo_dbms
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/mongodb/create_database.sh
|
|
mongo_dbms:
|
|
type: tosca.nodes.DBMS
|
|
requirements:
|
|
- host:
|
|
node: mongo_server
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/mongodb/create.sh
|
|
configure:
|
|
implementation: ../Scripts/mongodb/config.sh
|
|
inputs:
|
|
mongodb_ip: { get_attribute: [mongo_server, private_address] }
|
|
start: ../Scripts/mongodb/start.sh
|
|
elasticsearch:
|
|
type: tosca.nodes.SoftwareComponent.Elasticsearch
|
|
requirements:
|
|
- host:
|
|
node: elasticsearch_server
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/elasticsearch/create.sh
|
|
start: ../Scripts/elasticsearch/start.sh
|
|
logstash:
|
|
type: tosca.nodes.SoftwareComponent.Logstash
|
|
requirements:
|
|
- host:
|
|
node: logstash_server
|
|
- search_endpoint:
|
|
node: elasticsearch
|
|
capability: search_endpoint
|
|
relationship:
|
|
type: tosca.relationships.ConnectsTo
|
|
interfaces:
|
|
Configure:
|
|
pre_configure_source:
|
|
implementation: ../Python/logstash/configure_elasticsearch.py
|
|
inputs:
|
|
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/logstash/create.sh
|
|
start: ../Scripts/logstash/start.sh
|
|
kibana:
|
|
type: tosca.nodes.SoftwareComponent.Kibana
|
|
requirements:
|
|
- host:
|
|
node: kibana_server
|
|
- search_endpoint:
|
|
node: elasticsearch
|
|
capability: search_endpoint
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/kibana/create.sh
|
|
configure:
|
|
implementation: ../Scripts/kibana/config.sh
|
|
inputs:
|
|
elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
|
|
kibana_ip: { get_attribute: [kibana_server, private_address] }
|
|
start: ../Scripts/kibana/start.sh
|
|
app_collectd:
|
|
type: tosca.nodes.SoftwareComponent.Collectd
|
|
requirements:
|
|
- host:
|
|
node: app_server
|
|
- log_endpoint:
|
|
node: logstash
|
|
capability: log_endpoint
|
|
relationship:
|
|
type: tosca.relationships.ConnectsTo
|
|
interfaces:
|
|
Configure:
|
|
pre_configure_target:
|
|
implementation: ../Python/logstash/configure_collectd.py
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/collectd/create.sh
|
|
configure:
|
|
implementation: ../Python/collectd/config.py
|
|
inputs:
|
|
logstash_ip: { get_attribute: [logstash_server, private_address] }
|
|
start: ../Scripts/collectd/start.sh
|
|
app_rsyslog:
|
|
type: tosca.nodes.SoftwareComponent.Rsyslog
|
|
requirements:
|
|
- host:
|
|
node: app_server
|
|
- log_endpoint:
|
|
node: logstash
|
|
capability: log_endpoint
|
|
relationship:
|
|
type: tosca.relationships.ConnectsTo
|
|
interfaces:
|
|
Configure:
|
|
pre_configure_target:
|
|
implementation: ../Python/logstash/configure_rsyslog.py
|
|
interfaces:
|
|
Standard:
|
|
create: ../Scripts/rsyslog/create.sh
|
|
configure:
|
|
implementation: ../Scripts/rsyslog/config.sh
|
|
inputs:
|
|
logstash_ip: { get_attribute: [logstash_server, private_address] }
|
|
start: ../Scripts/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 ] }
|