blob: d308028ecfd3fddebd6d91b7cba34c6ddca39f34 [file] [log] [blame]
Eric Debeaude420982017-11-13 22:16:07 +00001DCAE Installation
2=================
Lusheng Jia73548f2017-11-05 19:24:05 -05003
4The below steps covers manual setup of DCAE VMs and DCAE service
5components.
6
7VESCollector
8------------
9
10 
11
12DCAE VES Collector can be configured on VM with ubuntu-16.04 image
13(m1.small should suffice if this is only service) and 20Gb cinder
14storage
15
161. Install docker
17
Eric Debeaude420982017-11-13 22:16:07 +000018.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -050019
Eric Debeaude420982017-11-13 22:16:07 +000020 sudo apt-get update
21 sudo apt install `docker.io <http://docker.io/>`__
Lusheng Jia73548f2017-11-05 19:24:05 -050022
232. Pull the latest container from onap nexus
24
Eric Debeaude420982017-11-13 22:16:07 +000025.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -050026
Eric Debeaude420982017-11-13 22:16:07 +000027 sudo docker login -u docker -p docker
28 `nexus.onap.org <http://nexus.onap.org/>`__:10001
29
30 sudo docker pull
31 `nexus.onap.org <http://nexus.onap.org/>`__:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1
Lusheng Jia73548f2017-11-05 19:24:05 -050032
333. Start the VESCollector with below command
34
Eric Debeaude420982017-11-13 22:16:07 +000035.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -050036
Eric Debeaude420982017-11-13 22:16:07 +000037 sudo docker run -d --name vescollector -p 8080:8080/tcp -p
38 8443:8443/tcp -P -e DMAAPHOST='<dmaap IP>'
39 `nexus.onap.org <http://nexus.onap.org/>`__:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1
40
41.. Note Change the dmaaphost to required DMAAP ip. To change the
42 dmaap information for a running container stop the active
43 container and rerun above command changing the dmaap IP.
Lusheng Jia73548f2017-11-05 19:24:05 -050044
454. Verification
46
47i. Check logs under container /opt/app/VESCollector/logs/collector.log
48 for errors
49
50ii. If no active feed, you can simulate an event into collector via curl
51
Eric Debeaude420982017-11-13 22:16:07 +000052.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -050053
Eric Debeaude420982017-11-13 22:16:07 +000054 curl --X POST -d @<sampleves> --header "Content-Type:application/json" -k http://localhost:8080/eventListener/v5
55
56.. Note: If DMAAPHOST provided is invalid, you will see exception
57 around publish on the collector.logs (collector queues and attempts
58 to resend the event hence exceptions reported will be periodic). 
Lusheng Jia73548f2017-11-05 19:24:05 -050059
60i. Below two topic configuration are pre-set into this container.  When
61 valid DMAAP instance ip was provided and VES events are received,
62 the collector will post to below topics.
63
64 Fault -
65  http://<dmaaphost>:3904/events/unauthenticated.SEC\_FAULT\_OUTPUT
66
67 Measurement
68 -http://<dmaaphost>:3904/events/unauthenticated.SEC\_MEASUREMENT\_OUTPUT
69
70VM Init
Eric Debeaude420982017-11-13 22:16:07 +000071~~~~~~~
Lusheng Jia73548f2017-11-05 19:24:05 -050072
73To address windriver server in-stability, the below **init.sh** script
74was used to start the container on VM restart.  
75
Eric Debeaude420982017-11-13 22:16:07 +000076.. code-block:: bash
77
78 #!/bin/sh
79 sudo docker ps | grep vescollector
80 if [ $? -ne 0 ]; then
81 sudo docker login -u docker -p docker nexus.onap.org:10001
82 sudo docker pull nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1
83 sudo docker rm -f vescollector
84 echo Collector process not running - $(date)” >> /home/ubuntu/startuplog
85 sudo docker run -d name vescollector -p 8080:8080/tcp -p 8443:8443/tcp -P -e DMAAPHOST=‘10.12.25.96 nexus.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:1.1
86 else
87 echo Collector process running - $(date)” >> /home/ubuntu/startuplog
88 fi
89
Lusheng Jia73548f2017-11-05 19:24:05 -050090
91This script was invoked via VM init script (rc.d).
92
Eric Debeaude420982017-11-13 22:16:07 +000093.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -050094
Eric Debeaude420982017-11-13 22:16:07 +000095 ln -s /home/ubuntu/init.sh /etc/init.d/init.sh
96 sudo  update-rc.d init.sh start 2
Lusheng Jia73548f2017-11-05 19:24:05 -050097
98 
99
100ThresholdCrossingAnalysis (TCA/CDAP)
101------------------------------------
102
103The platform deploys CDAP as cluster and instantiates TCA. For the
104manual setup, we will leverage the CDAP SDK docker container to deploy
105TCA instances To setup TCA, choose VM with ubuntu-16.04 image,
106m1.medium size and 50gb cinder volumes.
107
1081. Install docker
109
Eric Debeaude420982017-11-13 22:16:07 +0000110.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -0500111
Eric Debeaude420982017-11-13 22:16:07 +0000112 sudo apt-get update
113 sudo apt install `docker.io <http://docker.io/>`__
Lusheng Jia73548f2017-11-05 19:24:05 -0500114
1152. Pull CDAP SDK container
116
Eric Debeaude420982017-11-13 22:16:07 +0000117.. code-block:: bash
118
119 sudo docker pull caskdata/cdap-standalone:4.1.2
Lusheng Jia73548f2017-11-05 19:24:05 -0500120
1213. Deploy and run the CDAP container
122
Eric Debeaude420982017-11-13 22:16:07 +0000123.. code-block:: bash
124
125 sudo docker run -d --name cdap-sdk-2 -p 11011:11011 -p 11015:11015
126 caskdata/cdap-standalone:4.1.2
Lusheng Jia73548f2017-11-05 19:24:05 -0500127
1284. Create Namespace on CDAP application
129
Eric Debeaude420982017-11-13 22:16:07 +0000130.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -0500131
Eric Debeaude420982017-11-13 22:16:07 +0000132 curl -X PUT http://localhost:11015/v3/namespaces/cdap_tca_hi_lo
Lusheng Jia73548f2017-11-05 19:24:05 -0500133
Eric Debeaude420982017-11-13 22:16:07 +00001345. Create TCA app config file - "tca\_app\_config.json" under ~ubuntu as below
135
136.. code-block:: json
137
138 {
139 "artifact": {
140 "name": "dcae-analytics-cdap-tca",
141 "version": "2.0.0",
142 "scope": "user"
143 },
144
145 "config": {
146 "appName": "dcae-tca",
147 "appDescription": "DCAE Analytics Threshold Crossing Alert Application",
148 "tcaVESMessageStatusTableName": "TCAVESMessageStatusTable",
149 "tcaVESMessageStatusTableTTLSeconds": 86400.0,
150 "tcaAlertsAbatementTableName": "TCAAlertsAbatementTable",
151 "tcaAlertsAbatementTableTTLSeconds": 1728000.0,
152 "tcaVESAlertsTableName": "TCAVESAlertsTable",
153 "tcaVESAlertsTableTTLSeconds": 1728000.0,
154 "thresholdCalculatorFlowletInstances": 2.0,
155 "tcaSubscriberOutputStreamName": "TCASubscriberOutputStream"
156 }
157 }
158
Lusheng Jia73548f2017-11-05 19:24:05 -0500159
1606. Create TCA app preference file under ~ubuntu as below
161
Eric Debeaude420982017-11-13 22:16:07 +0000162.. code-block:: json
Lusheng Jia73548f2017-11-05 19:24:05 -0500163
Eric Debeaude420982017-11-13 22:16:07 +0000164 {
165 "publisherContentType" : "application/json",
166 "publisherHostName" : "10.12.25.96",
167 "publisherHostPort" : "3904",
168 "publisherMaxBatchSize" : "1",
169 "publisherMaxRecoveryQueueSize" : "100000",
170 "publisherPollingInterval" : "20000",
171 "publisherProtocol" : "http",
172 "publisherTopicName" : "unauthenticated.DCAE_CL_OUTPUT",
173 "subscriberConsumerGroup" : "OpenDCAE-c1",
174 "subscriberConsumerId" : "c1",
175 "subscriberContentType" : "application/json",
176 "subscriberHostName" : "10.12.25.96",
177 "subscriberHostPort" : "3904",
178 "subscriberMessageLimit" : "-1",
179 "subscriberPollingInterval" : "20000",
180 "subscriberProtocol" : "http",
181 "subscriberTimeoutMS" : "-1",
182 "subscriberTopicName" : "unauthenticated.SEC_MEASUREMENT_OUTPUT",
183 "enableAAIEnrichment" : false,
184 "aaiEnrichmentHost" : "10.12.25.72",
185 "aaiEnrichmentPortNumber" : 8443,
186 "aaiEnrichmentProtocol" : "https",
187 "aaiEnrichmentUserName" : "DCAE",
188 "aaiEnrichmentUserPassword" : "DCAE",
189 "aaiEnrichmentIgnoreSSLCertificateErrors" : false,
190 "aaiVNFEnrichmentAPIPath" : "/aai/v11/network/generic-vnfs/generic-vnf",
191 "aaiVMEnrichmentAPIPath" : "/aai/v11/search/nodes-query",
192 "tca_policy" : {
193 "domain": "measurementsForVfScaling",
194 "metricsPerEventName": [{
195 "eventName": "vFirewallBroadcastPackets",
196 "controlLoopSchemaType": "VNF",
197 "policyScope": "DCAE",
198 "policyName": "DCAE.Config_tca-hi-lo",
199 "policyVersion": "v0.0.1",
200 "thresholds": [{
201 "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
202 "version": "1.0.2",
203 "fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
204 "thresholdValue": 300,
205 "direction": "LESS_OR_EQUAL",
206 "severity": "MAJOR",
207 "closedLoopEventStatus": "ONSET"
208 }, {
209 "closedLoopControlName": "ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a",
210 "version": "1.0.2",
211 "fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
212 "thresholdValue": 700,
213 "direction": "GREATER_OR_EQUAL",
214 "severity": "CRITICAL",
215 "closedLoopEventStatus": "ONSET"
216 }]
217 }, {
218 "eventName": "vLoadBalancer",
219 "controlLoopSchemaType": "VM",
220 "policyScope": "DCAE",
221 "policyName": "DCAE.Config_tca-hi-lo",
222 "policyVersion": "v0.0.1",
223 "thresholds": [{
224 "closedLoopControlName": "ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3",
225 "version": "1.0.2",
226 "fieldPath": "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta",
227 "thresholdValue": 300,
228 "direction": "GREATER_OR_EQUAL",
229 "severity": "CRITICAL",
230 "closedLoopEventStatus": "ONSET"
231 }]
232 }, {
233 "eventName": "Measurement_vGMUX",
234 "controlLoopSchemaType": "VNF",
235 "policyScope": "DCAE",
236 "policyName": "DCAE.Config_tca-hi-lo",
237 "policyVersion": "v0.0.1",
238 "thresholds": [{
239 "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
240 "version": "1.0.2",
241 "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
242 "thresholdValue": 0,
243 "direction": "EQUAL",
244 "severity": "MAJOR",
245 "closedLoopEventStatus": "ABATED"
246 }, {
247 "closedLoopControlName": "ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e",
248 "version": "1.0.2",
249 "fieldPath": "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value",
250 "thresholdValue": 0,
251 "direction": "GREATER",
252 "severity": "CRITICAL",
253 "closedLoopEventStatus": "ONSET"
254 }]
255 }]
256 }
257 }
Lusheng Jia73548f2017-11-05 19:24:05 -0500258
Lusheng Jia73548f2017-11-05 19:24:05 -0500259
Eric Debeaude420982017-11-13 22:16:07 +0000260.. Note: Dmaap configuration are specified on this file on
261 publisherHostName and subscriberHostName. To be changed as
262 required\*\*
263
2647. Copy below script to CDAP server (this gets latest image from nexus and deploys TCA application) and execute it
265
266.. code-block:: bash
267
268 #!/bin/sh
269 TCA_JAR=dcae-analytics-cdap-tca-2.0.0.jar
270 rm -f /home/ubuntu/$TCA_JAR
271 cd /home/ubuntu/
272 wget https://nexus.onap.org/service/local/repositories/staging/content/org/onap/dcaegen2/analytics/tca/dcae-analytics-cdap-tca/2.0.0/$TCA_JAR
273 if [ $? -eq 0 ]; then
274 if [ -f /home/ubuntu/$TCA_JAR ]; then
275 echo Restarting TCA CDAP application using $TCA_JAR artifact
276 else
277 echo ERROR: $TCA_JAR missing
278 exit 1
279 fi
280 else
281 echo ERROR: $TCA_JAR not found in nexus
282 exit 1
283 fi
284 # stop programs
285 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/stop
286 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/stop
287 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/stop
288 # delete application
289 curl -X DELETE http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca
290 # delete artifact
291 curl -X DELETE http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca/versions/2.0.0
292 # load artifact
293 curl -X POST data-binary @/home/ubuntu/$TCA_JAR http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca
294 # create app
295 curl -X PUT -d @/home/ubuntu/tca_app_config.json http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca
296 # load preferences
297 curl -X PUT -d @/home/ubuntu/tca_app_preferences.json http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/preferences
298 # start programs
299 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/start
300 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/start
301 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/start
302 echo
303 # get status of programs
304 curl http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/status
305 curl http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/status
306 curl http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/status
307 echo
308
Lusheng Jia73548f2017-11-05 19:24:05 -0500309
3108. Verify TCA application and logs via CDAP GUI processes
311
312 The overall flow can be checked here
313
314TCA Configuration Change
Eric Debeaude420982017-11-13 22:16:07 +0000315~~~~~~~~~~~~~~~~~~~~~~~~
Lusheng Jia73548f2017-11-05 19:24:05 -0500316
317Typical configuration changes include changing DMAAP host and/or Policy configuration. If necessary, modify the file on step #6 and run the script noted as step #7 to redeploy TCA with updated configuration.
Lusheng Jia73548f2017-11-05 19:24:05 -0500318
319VM Init
Eric Debeaude420982017-11-13 22:16:07 +0000320~~~~~~~
Lusheng Jia73548f2017-11-05 19:24:05 -0500321
322To address windriver server in-stability, the below **init.sh** script
323was used to restart the container on VM restart.  This script was
324invoked via VM init script (rc.d).
325
Eric Debeaude420982017-11-13 22:16:07 +0000326.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -0500327
Eric Debeaude420982017-11-13 22:16:07 +0000328 #!/bin/sh
329 #docker run -d –name cdap-sdk -p 11011:11011 -p 11015:11015 caskdata/cdap-standalone:4.1.2
330 sudo docker restart cdap-sdk-2
331 sleep 30
332 # start program
333 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/start
334 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/start
335 curl -X POST http://localhost:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/start
336
Lusheng Jia73548f2017-11-05 19:24:05 -0500337
338This script was invoked via VM init script (rc.d).
339
Eric Debeaude420982017-11-13 22:16:07 +0000340.. code-block:: bash
Lusheng Jia73548f2017-11-05 19:24:05 -0500341
Eric Debeaude420982017-11-13 22:16:07 +0000342 ln -s /home/ubuntu/init.sh /etc/init.d/init.sh
343 sudo  update-rc.d init.sh start 2