blob: b5c7f97a34bf084b90fa71edb40e182fe7552e77 [file] [log] [blame]
Chengkai Yan7f278e32018-11-06 16:32:03 +01001.. This work is licensed under a Creative Commons Attribution 4.0 International License.
2.. http://creativecommons.org/licenses/by/4.0
3
maximesson26d51b62019-07-23 09:40:54 +00004=============================
elinuxhenrik9297dd92019-07-01 08:42:50 +00005Configuration and Performance
6=============================
maximessone0a42852019-08-16 08:43:37 +00007The DataFile Collector (DFC) gets fileReady messages from the Message Router (MR) sent from xNFs, via the VES Collector.
8These messages contains data about files ready to get from the xNF. DFC then collects these files from the xNF and
9publishes them to the DataRouter (DR) on a feed. Consumers can subscribe to the feed from DR and process the file for
10its specific purpose. The connection between a file type and the feed it will be published to is the
11**changeIdentifier**. DFC can handle multiple **changeIdentifier**/feed combinations, see picture below.
12
13.. image:: ../../images/DFC_config.png
14
15
Chengkai Yan7f278e32018-11-06 16:32:03 +010016
maximesson26d51b62019-07-23 09:40:54 +000017Configuration
18^^^^^^^^^^^^^
19By default, DFC handles the "PM_MEAS_FILES" change identifier and publishes these files on the "bulk_pm_feed" feed.
maximessone0a42852019-08-16 08:43:37 +000020But it can also be configured to handle more/other change identifiers and publish them to more/other feeds. The
21configuration of DFC is controlled via a blueprint.
Chengkai Yan7f278e32018-11-06 16:32:03 +010022
maximesson26d51b62019-07-23 09:40:54 +000023Blueprint Configuration Explained
24"""""""""""""""""""""""""""""""""
Chengkai Yan7f278e32018-11-06 16:32:03 +010025
maximessone0a42852019-08-16 08:43:37 +000026For the communication with the Message Router, the user must provide the **host name**, **port**, and **protocol** of
27the DMaaP Message router.
Chengkai Yan7f278e32018-11-06 16:32:03 +010028
maximesson26d51b62019-07-23 09:40:54 +000029.. code-block:: yaml
30 :emphasize-lines: 2,6,10
Chengkai Yan7f278e32018-11-06 16:32:03 +010031
maximesson26d51b62019-07-23 09:40:54 +000032 inputs:
33 dmaap_mr_host:
34 type: string
35 description: dmaap messagerouter host
36 default: message-router.onap.svc.cluster.local
37 dmaap_mr_port:
38 type: integer
39 description: dmaap messagerouter port
40 default: 3904
41 dmaap_mr_protocol:
42 type: string
43 description: dmaap messagerouter protocol
44 default: "http"
Chengkai Yan7f278e32018-11-06 16:32:03 +010045
maximesson26d51b62019-07-23 09:40:54 +000046The user can also specify which version of DFC to use.
Chengkai Yan7f278e32018-11-06 16:32:03 +010047
maximesson26d51b62019-07-23 09:40:54 +000048.. code-block:: yaml
49 :emphasize-lines: 2
Chengkai Yan7f278e32018-11-06 16:32:03 +010050
maximesson26d51b62019-07-23 09:40:54 +000051 inputs:
52 tag_version:
53 type: string
54 description: DFC image tag/version
55 default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.2.0"
Chengkai Yan7f278e32018-11-06 16:32:03 +010056
maximesson26d51b62019-07-23 09:40:54 +000057The user can also enable secure communication with the DMaaP Message Router.
Chengkai Yan7f278e32018-11-06 16:32:03 +010058
maximesson26d51b62019-07-23 09:40:54 +000059.. code-block:: yaml
60 :emphasize-lines: 2
maximessonc762eb12019-04-04 14:43:43 +000061
maximesson26d51b62019-07-23 09:40:54 +000062 inputs:
63 secureEnableCert:
64 type: boolean
65 description: enable certificate based connection with DMaap
66 default: false
maximessonc762eb12019-04-04 14:43:43 +000067
maximessone0a42852019-08-16 08:43:37 +000068DFC can handle multiple change identifiers. For each change identifier/feed combination the user must provide the
69**change identifier**, **feed name**, and **feed location**.
maximessonc762eb12019-04-04 14:43:43 +000070
maximessone0a42852019-08-16 08:43:37 +000071**Note!** The **feed name** provided should be used by the consumer/s to set up the subscription to the feed.
maximessonc762eb12019-04-04 14:43:43 +000072
maximessone0a42852019-08-16 08:43:37 +000073The **feed name** and **feed location** are defined as inputs for the user to provide.
Chengkai Yan7f278e32018-11-06 16:32:03 +010074
maximesson26d51b62019-07-23 09:40:54 +000075.. code-block:: yaml
76 :emphasize-lines: 2,6
Chengkai Yan7f278e32018-11-06 16:32:03 +010077
maximesson26d51b62019-07-23 09:40:54 +000078 inputs:
maximessone0a42852019-08-16 08:43:37 +000079 feed0_name:
maximesson26d51b62019-07-23 09:40:54 +000080 type: string
81 description: The name of the feed the files will be published to. Should be used by the subscriber.
82 default: "bulk_pm_feed"
maximessone0a42852019-08-16 08:43:37 +000083 feed0_location:
maximesson26d51b62019-07-23 09:40:54 +000084 type: string
maximessone0a42852019-08-16 08:43:37 +000085 description: The location of the feed.
86 default: "loc00"
Chengkai Yan7f278e32018-11-06 16:32:03 +010087
maximessone0a42852019-08-16 08:43:37 +000088The **feed name** shall be used in the definition of the feed for the DMaaP plugin under the "**node_templates**"
89section under a tag for the internal "**feed identifier**" for the feed (feed0 in the example).
Chengkai Yan7f278e32018-11-06 16:32:03 +010090
maximesson26d51b62019-07-23 09:40:54 +000091.. code-block:: yaml
maximessone0a42852019-08-16 08:43:37 +000092 :emphasize-lines: 1,5
maximesson26d51b62019-07-23 09:40:54 +000093
maximessone0a42852019-08-16 08:43:37 +000094 feed0:
95 type: ccsdk.nodes.Feed
96 properties:
97 feed_name:
98 get_input: feed0_name
99 useExisting: true
maximesson26d51b62019-07-23 09:40:54 +0000100
maximessone0a42852019-08-16 08:43:37 +0000101The **feed location** shall be used under the **streams_publishes** section under a tag for the internal
102"**feed identifier**" for the feed.
maximesson26d51b62019-07-23 09:40:54 +0000103
104.. code-block:: yaml
maximessone0a42852019-08-16 08:43:37 +0000105 :emphasize-lines: 2,4
maximesson26d51b62019-07-23 09:40:54 +0000106
maximessone0a42852019-08-16 08:43:37 +0000107 streams_publishes:
108 - name: feed0
109 location:
110 get_input: feed0_location
111 type: data_router
maximesson26d51b62019-07-23 09:40:54 +0000112
maximessone0a42852019-08-16 08:43:37 +0000113The **change identifier** shall be defined as an item under the **streams_publishes** tag in the "**application_config**"
114section. Under this tag the internal "**feed identifier**" for the feed shall also be added to get the
115info about the feed substituted in by CBS (that's what the <<>> tags are for).
maximesson26d51b62019-07-23 09:40:54 +0000116
117.. code-block:: yaml
maximessone0a42852019-08-16 08:43:37 +0000118 :emphasize-lines: 4,5
maximesson26d51b62019-07-23 09:40:54 +0000119
maximessone0a42852019-08-16 08:43:37 +0000120 application_config:
121 service_calls: []
122 streams_publishes:
123 PM_MEAS_FILES:
124 dmaap_info: <<feed0>>
125 type: data_router
126
127And, lastly, to set up the publication relationship for the feed, the "**feed identifier**" must be added to the
128"**relationships**" section of the blueprint.
129
130.. code-block:: yaml
131 :emphasize-lines: 3
132
133 relationships:
134 - type: ccsdk.relationships.publish_files
135 target: feed0
maximesson26d51b62019-07-23 09:40:54 +0000136
137Sample blueprint configuration
138""""""""""""""""""""""""""""""
139
140The format of the blueprint configuration that drives all behavior of DFC is probably best described using an example.
141The blueprint below configures DFC to handle the two feeds shown in the picture above.
142
143.. code-block:: yaml
144
145 inputs:
146 dmaap_mr_host:
147 type: string
148 description: dmaap messagerouter host
149 default: message-router.onap.svc.cluster.local
150 dmaap_mr_port:
151 type: integer
152 description: dmaap messagerouter port
153 default: 3904
154 dmaap_mr_protocol:
155 type: string
156 description: dmaap messagerouter protocol
157 default: "http"
158 tag_version:
159 type: string
160 description: DFC image tag/version
161 default: "nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:1.2.0"
162 replicas:
163 type: integer
164 description: number of instances
165 default: 1
166 secureEnableCert:
167 type: boolean
168 description: enable certificate based connection with DMaap
169 default: false
maximessone0a42852019-08-16 08:43:37 +0000170 envs:
171 default: {}
172 feed0_name:
maximesson26d51b62019-07-23 09:40:54 +0000173 type: string
174 description: The name of the feed the files will be published to. Should be used by the subscriber.
175 default: "bulk_pm_feed"
maximessone0a42852019-08-16 08:43:37 +0000176 feed0_location:
maximesson26d51b62019-07-23 09:40:54 +0000177 type: string
maximessone0a42852019-08-16 08:43:37 +0000178 description: The location of the feed.
179 default: "loc00"
180 feed1_name:
maximesson26d51b62019-07-23 09:40:54 +0000181 type: string
182 description: The name of the feed the files will be published to. Should be used by the subscriber.
183 default: "log_feed"
maximessone0a42852019-08-16 08:43:37 +0000184 feed1_location:
maximesson26d51b62019-07-23 09:40:54 +0000185 type: string
maximessone0a42852019-08-16 08:43:37 +0000186 description: The location of the feed.
187 default: "loc00"
maximesson26d51b62019-07-23 09:40:54 +0000188 node_templates:
maximesson26d51b62019-07-23 09:40:54 +0000189 datafile-collector:
190 type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
maximesson26d51b62019-07-23 09:40:54 +0000191 interfaces:
192 cloudify.interfaces.lifecycle:
193 start:
194 inputs:
maximessone0a42852019-08-16 08:43:37 +0000195 envs:
196 get_input: envs
maximesson26d51b62019-07-23 09:40:54 +0000197 properties:
maximesson26d51b62019-07-23 09:40:54 +0000198 application_config:
maximessone0a42852019-08-16 08:43:37 +0000199 service_calls: []
maximesson26d51b62019-07-23 09:40:54 +0000200 dmaap.security.enableDmaapCertAuth: { get_input: secureEnableCert }
maximesson26d51b62019-07-23 09:40:54 +0000201 streams_subscribes:
202 dmaap_subscriber:
maximesson26d51b62019-07-23 09:40:54 +0000203 dmaap_info:
204 topic_url:
205 { concat: [{ get_input: dmaap_mr_protocol },"://",{ get_input: dmaap_mr_host },
206 ":",{ get_input: dmaap_mr_port },"/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12"]}
maximessone0a42852019-08-16 08:43:37 +0000207 streams_publishes:
208 PM_MEAS_FILES:
209 dmaap_info: <<feed0>>
210 type: data_router
211 LOG_FILES:
212 dmaap_info: <<feed1>>
213 type: data_router
214 image:
215 get_input: tag_version
216 service_component_type: datafile-collector
maximesson26d51b62019-07-23 09:40:54 +0000217 streams_publishes:
maximessone0a42852019-08-16 08:43:37 +0000218 - name: feed0
219 location:
220 get_input: feed0_location
221 type: data_router
222 - name: feed1
223 location:
224 get_input: feed1_location
225 type: data_router
226 relationships:
227 - type: ccsdk.relationships.publish_files
228 target: feed0
229 - type: ccsdk.relationships.publish_files
230 target: feed1
231 feed0:
232 type: ccsdk.nodes.Feed
233 properties:
234 feed_name:
235 get_input: feed0_name
236 useExisting: true
237 feed1:
238 type: ccsdk.nodes.Feed
239 properties:
240 feed_name:
241 get_input: feed1_name
242 useExisting: true
elinuxhenrik9297dd92019-07-01 08:42:50 +0000243
Tomasz Wrobel7ecee492020-07-24 10:02:06 +0200244.. _strict_host_checking_config:
245
246Turn On/Off StrictHostChecking
247------------------------------
248**StrictHostChecking** is a SSH connection option which prevents Man in the Middle (MitM) attacks. If it is enabled, client checks HostName and public key provided by server and compares it with keys stored locally. Only if matching entry is found, SSH connection can be established.
249By default in DataFile Collector this option is enabled (true) and requires to provide known_hosts list to DFC container.
250
251**Important: DFC requires public keys in sha-rsa KeyAlgorithm**
252
253**Known_hosts file** is a list in following format:
254
255.. code-block:: bash
256
257 <HostName/HostIP> <KeyAlgorithms> <Public Key>
258
259e.g:
260
261.. code-block:: bash
262
263 172.17.0.3 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDRibxPenQC//2hzTuscdQDUA7P3gB9k4E8IgwCJxZM8YrJ2vqHomN8boByubebvo0L8+DWqzAtjy0nvgzsoEme9Y3lLWZ/2g9stlsOurwm+nFmWn/RPnwjqsAGNQjukV8C9D82rPMOYRES6qSGactFw4i8ZWLH8pmuJ3js1jb91HSlwr4zbZZd2XPKHk3nudyh8/Mwf3rndCU5FSnzjpBo55m48nsl2M1Tb6Xj1R0jQc5LWN0fsbrm5m+szsk4ccgHw6Vj9dr0Jh4EaIpNwA68k4LzrWb/N20bW8NzUsyDSQK8oEo1dvsiw8G9/AogBjQu9N4bqKWcrk5DOLCZHiCTSbbvdMWAMHXBdxEt9GZ0V53Fzwm8fI2EmIHdLhI4BWKZajumsfHRnd6UUxxna9ySt6qxVYZTyrPvfOFR3hRxVaxHL3EXplGeHT8fnoj+viai+TeSDdjMNwqU4MrngzrNKNLBHIl705uASpHUaRYQxUfWw/zgKeYlIbH+aGgE+4Q1vnh10Y35pATePRZgBIu+h2KsYBAtrP88LqW562OQ6T7VkfoAYwOjx9WV3/y5qonsStPhhzmJHDF22oBh5E5tZQxRcIlQF+5kHmXnFRUZtWshFnQATBh3yhOzJbh66CXn7aPj5Kl8TuuSN48zuI2lulVVqcv7GmTS0tWNpbxpzw==
264
265HostName could also be hashed, e.g:
266
267.. code-block:: bash
268
269 |1|FwSOxXYeJyZMAQM3jREjLSIcxRw=|o/b+CHEeHuED7WZS6sb3Y1IyHjk= ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDRibxPenQC//2hzTuscdQDUA7P3gB9k4E8IgwCJxZM8YrJ2vqHomN8boByubebvo0L8+DWqzAtjy0nvgzsoEme9Y3lLWZ/2g9stlsOurwm+nFmWn/RPnwjqsAGNQjukV8C9D82rPMOYRES6qSGactFw4i8ZWLH8pmuJ3js1jb91HSlwr4zbZZd2XPKHk3nudyh8/Mwf3rndCU5FSnzjpBo55m48nsl2M1Tb6Xj1R0jQc5LWN0fsbrm5m+szsk4ccgHw6Vj9dr0Jh4EaIpNwA68k4LzrWb/N20bW8NzUsyDSQK8oEo1dvsiw8G9/AogBjQu9N4bqKWcrk5DOLCZHiCTSbbvdMWAMHXBdxEt9GZ0V53Fzwm8fI2EmIHdLhI4BWKZajumsfHRnd6UUxxna9ySt6qxVYZTyrPvfOFR3hRxVaxHL3EXplGeHT8fnoj+viai+TeSDdjMNwqU4MrngzrNKNLBHIl705uASpHUaRYQxUfWw/zgKeYlIbH+aGgE+4Q1vnh10Y35pATePRZgBIu+h2KsYBAtrP88LqW562OQ6T7VkfoAYwOjx9WV3/y5qonsStPhhzmJHDF22oBh5E5tZQxRcIlQF+5kHmXnFRUZtWshFnQATBh3yhOzJbh66CXn7aPj5Kl8TuuSN48zuI2lulVVqcv7GmTS0tWNpbxpzw==
270
271
272
273To provide known_hosts list to DFC, execute following steps:
274
2751. Create file called known_hosts with desired entries.
276
2772. Mount file using Kubernetes Config Map.
278
279.. code-block:: bash
280
281 kubectl -n <ONAP NAMESPACE> create cm <config map name> --from-file <path to known_hosts file>
282
283e.g:
284
285.. code-block:: bash
286
287 kubectl -n onap create cm onap-dcae-dfc-known-hosts --from-file /home/ubuntu/.ssh/known_hosts
288
289
2903. Mount newly created Config Map as Volume to DFC by editing DFC deployment. **DFC deployment contains 3 containers, pay attention to mount the file to the appropriate container.**
291
292.. code-block:: yaml
293
294 ...
295 kind: Deployment
296 metadata:
297 ...
298 spec:
299 ...
300 template:
301 ...
302 spec:
303 containers:
304 - image: <DFC image>
305 ...
306 volumeMounts:
307 ...
308 - mountPath: /home/datafile/.ssh/
309 name: onap-dcae-dfc-known-hosts
310 ...
311 volumes:
312 ...
313 - configMap:
314 name: <config map name, same as in step 1, e.g. onap-dcae-dfc-known-hosts>
315 name: onap-dcae-dfc-known-hosts
316 ...
317
318Known_hosts file path can be controlled by Environment Variable *KNOWN_HOSTS_FILE_PATH*. Full (absolute) path has to be provided. Sample deployment with changed known_hosts file path can be seen below.
319
320.. code-block:: yaml
321
322 ...
323 kind: Deployment
324 metadata:
325 ...
326 spec:
327 ...
328 template:
329 ...
330 spec:
331 containers:
332 - image: <DFC image>
333 envs:
334 - name: KNOWN_HOSTS_FILE_PATH
335 value: /home/datafile/.ssh/new/path/<known_hosts file name, e.g. my_custom_keys>
336 ...
337 volumeMounts:
338 ...
339 - mountPath: /home/datafile/.ssh/new/path
340 name: onap-dcae-dfc-known-hosts
341 ...
342 volumes:
343 ...
344 - configMap:
345 name: <config map name, same as in step 1, e.g. onap-dcae-dfc-known-hosts>
346 name: onap-dcae-dfc-known-hosts
347 ...
348
349To change mounted known_hosts list, edit existing Config Map or delete and create it again. **The DFC container may refresh changes with a delay.** Pod, nor container restart is NOT required.
350
351To edit Config Map execute:
352
353.. code-block:: bash
354
355 kubectl -n <ONAP NAMESPACE> edit cm <config map name>
356
357e.g:
358
359.. code-block:: bash
360
361 kubectl -n onap edit cm onap-dcae-dfc-known-hosts
362
363To delete and create again Config Map execute:
364
365.. code-block:: bash
366
367 kubectl -n <ONAP NAMESPACE> delete cm <config map name>
368 kubectl -n <ONAP NAMESPACE> create cm <config map name> --from-file <path to known_hosts file>
369
370e.g:
371
372.. code-block:: bash
373
374 kubectl -n onap delete cm onap-dcae-dfc-known-hosts
375 kubectl -n onap create cm onap-dcae-dfc-known-hosts --from-file /home/ubuntu/.ssh/known_hosts
376
377
378To turn off StrictHostChecking, set below option to false. It could be changed in DCAE Config Binding Service (CBS).
379
380**WARNING: such operation is not recommended as it decreases DFC security and exposes DFC to MitM attacks.**
381
382.. code-block:: bash
383
384 "sftp.security.strictHostKeyChecking": false
385
386
elinuxhenrik9297dd92019-07-01 08:42:50 +0000387Performance
388^^^^^^^^^^^
389
390To see the performance of DFC, see "`Datafile Collector (DFC) performance baseline results`_".
391
maximessone0a42852019-08-16 08:43:37 +0000392.. _Datafile Collector (DFC) performance baseline results: https://wiki.onap.org/display/DW/Datafile+Collector+%28DFC%29+performance+baseline+results