edge2ai-workshop

edge2ai-workshop

Edge2AI Workshop

Stars: 68

Visit
 screenshot

The edge2ai-workshop repository provides a hands-on workshop for building an IoT Predictive Maintenance workflow. It includes lab exercises for setting up components like NiFi, Streams Processing, Data Visualization, and more on a single host. The repository also covers use cases such as credit card fraud detection. Users can follow detailed instructions, prerequisites, and connectivity guidelines to connect to their cluster and explore various services. Additionally, troubleshooting tips are provided for common issues like MiNiFi not sending messages or CEM not picking up new NARs.

README:

= CDF Workshops

== Introduction

In this hands-on workshop, you will build a full OT to IT workflow for an IoT Predictive Maintenance use case. Below is the architecture diagram, showing all the components you will setup over the lab exercises. While the diagram divides the components according to their location (factory, regional or datacenter level) in this workshop all such components will reside in one single host.

image::images/iot-architecture.png[width=800]

=== Workshops

IMPORTANT: If this is your first time going through this content, please read the rest of this README introduction before jumping to the Labs.

If you already familiar with the instructions in the README, time to start working and see some interesting stuff! Pick your lab and let's get started!

  • link:workshop_edge.adoc[Ingesting data from the edge]
  • link:workshop_nifi.adoc[NiFi and Streams Processing]
  • link:workshop_dataviz.adoc[Creating Dashboards with Cloudera Data Viz]
  • link:workshop_ssb.adoc[Querying streams with SQL]
  • link:workshop_cdc.adoc[Change Data Capture (CDC) with Flink/SSB]
  • link:streams_replication.adoc[Streams Replication]
  • link:spark_analytics.adoc[Spark and Fast Analytics with Kudu]
  • link:datascience.adoc[CDSW Experiments and Models]

Use cases:

  • link:workshop_fraud.adoc[Credit card fraud detection]

=== Before you start

  • Everything is Case-Sensitive.
  • Check all your connections and spellings
  • If you hit any problems like, for example, MiNiFi Not Sending Messages, check for clues in the <> section below.

=== Pre-requisites

  • Laptop with a supported OS (Windows 7 not supported).
  • A modern browser like Google Chrome or Firefox (IE not supported).

=== Connecting to your cluster

You instructor will give access to a registration link where you can request a cluster. You should have 2 addresses for you one-node cluster: the public DNS name and the public IP address. With those addresses you can test the following connectivity to your cluster:

NOTE: The credentials for all the services below that require authentication are admin/Supersecret1 (capital "S").

. Ensure you can connect to the following service using your browser: + [%autowidth,options="header"] |=== |Service|URL|Comments |Cloudera Manager|http://<public_dns>:7180/|Port 7183 when TLS is enabled |Atlas|http://<public_dns>:31000/|Port 31443 when TLS is enabled |CDSW|http://cdsw.<public_IP>.nip.io/|admin/Supersecret1 |CDP Data Visualization|http://viz.cdsw.<public_IP>.nip.io/| |Edge Flow Manager|http://<public_dns>:10088/efm/ui/| |Flink Dashboard|http://<public_dns>:8078/| |Hue|http://<public_dns>:8889/| |Knox|https://<public_dns>:9443/gateway/homepage/home/|Only when security is enabled |NiFi|http://<public_dns>:8080/nifi/|Port 8443 when TLS is enabled |NiFi Registry|http://<public_dns>:18080/nifi-registry/|Port 18433 when TLS is enabled |Ranger|https://<public_dns>:6182/|Only when security is enabled |Schema Registry|http://<public_dns>:7788/|Port 7790 when TLS is enabled |SMM|http://<public_dns>:9991/| |SQL Stream Builder (SSB)|http://<public_dns>:18121/|For SSB versions older than 1.7 use this instead: http://<public_dns>:18121/ |=== . Login into Cloudera Manager and familiarize yourself with the services installed . Login into Hue. As you are the first user to login into Hue, you are granted admin privileges. At this point, you won't need to do anything on Hue, but by logging in, CDH has created your HDFS user and folder, which you will need for the next lab.

Below a screenshot of Chrome open with 8 tabs, one for each service.

image::images/browser.png[width=800]

=== (Optional) SSH access

This access is not required for the workshop labs. You can skip this section.

SSH access is only required if you need to troubleshoot issues or want to poke around your clusters. The procedure to connect via SSH depends on the type of computer you're using:

==== SSH into the cluster from the Web UI

From the registration link, you can click on the link at the right side to connect to the cluster from a web based SSH client with the credential centos/Supersecret1.

==== SSH into the cluster from Linux/Macos

From the registration link, download the PEM key required to access to your cluster with SSH. Run the following command:


chmod 400 workshop.pem ssh -i workshop.pem centos@you-ip-address

==== SSH into the cluster from Windows

From the registration link, download the PEM key required to access to your cluster with SSH. We will use link:https://www.putty.org/[PuTTY] to connect to the cluster. However, Putty doesn't accept PEM key. Follow these instructions to convert your PEM key into a PPK key and connect to the cluster

Convert your key with PuTTYgen:

. Use PuTTYgen to convert .PEM file to .PPK file. . Start PuTTYgen and select “Load” . Select your .PEM file. . Putty will convert the .PEM format to .PPK format. . Select “Save Private Key” A passphrase is not required but can be used if additional security is required.

Connect with PuTTY:

. Launch PuTTY and enter the host IP address. . Navigate to Connection/SSH/Auth . Click “Browse” and select the .PPK file you exported from PuTTYgen. . Click “Open.”

== Resources

[[troubleshooting, Troubleshooting]] == Troubleshooting

==== General

  • Everything is Case-Sensitive.
  • Check all your connections and spellings

==== MiNiFi Not Sending Messages

  • Make sure you pick HTTP, not RAW, in Cloud Connection to NiFi
  • Make sure there are no spaces before or after Destination ID, URL, Names, Topics, Brokers, etc...
  • Make sure there are no spaces anywhere!
  • Everything is Case-Sensitive. For example, the bucket name in NiFi Registry is IoT, not iot.
  • Check /opt/cloudera/cem/minifi/logs/minifi-app.log if you can't find an issue
  • You must have HDFS User Created via HUE, Go there First

==== CEM doesn't pick up new NARs

. Delete the agent manifest manually using the EFM API:

. Verify each class has the same agent manifest ID: + [source]

http://hostname:10088/efm/api/agent-classes [{"name":"iot1","agentManifests":["agent-manifest-id"]},{"name":"iot4","agentManifests":["agent-manifest-id"]}]

. Confirm the manifest doesn't have the NAR you installed + [source]

http://hostname:10088/efm/api/agent-manifests?class=iot4 [{"identifier":"agent-manifest-id","agentType":"minifi-java","version":"1","buildInfo":{"timestamp":1556628651811,"compiler":"JDK 8"},"bundles":[{"group":"default","artifact":"system","version":"unversioned","componentManifest":{"controllerServices":[],"processors":

. Call the API endpoint: + [source]

. Hit the DELETE - Delete the agent manifest specified by id button, and in the id field, enter `agent-manifest-id

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for edge2ai-workshop

Similar Open Source Tools

For similar tasks

For similar jobs