You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Cluster monitoring with Prometheus and Grafana in Amazon EKS
2
+
title: Monitor the cluster with Prometheus and Grafana
3
3
weight: 5
4
4
5
5
### FIXED, DO NOT MODIFY
6
6
layout: learningpathall
7
7
---
8
8
9
-
## CPU and RAM usage statistics with Prometheus and Grafana
9
+
## Monitor CPU and RAM usage with Prometheus and Grafana
10
10
11
-
Prometheus is a monitoring and alerting tool. It is used for collecting and querying real-time metrics in cloud-native environments like Kubernetes. Prometheus collects essential metrics (e.g., CPU, memory usage, pod counts, request latency) that help in monitoring the health and performance of Kubernetes clusters. Grafana is a visualization and analytics tool that integrates with data sources from Prometheus, to create interactive dashboards to monitor and analyze Kubernetes metrics over time.
11
+
Prometheus is a monitoring and alerting tool. It is used for collecting and querying real-time metrics in cloud-native environments like Kubernetes. Prometheus collects essential metrics about CPU usage, memory usage, pod counts, and request latency. This helps you monitor the health and performance of your Kubernetes clusters.
12
12
13
+
Grafana is a visualization and analytics tool that integrates with data sources from Prometheus to create interactive dashboards to monitor and analyze Kubernetes metrics over time.
13
14
14
-
## Install Prometheus on Arm-based EKS cluster
15
+
## Install Prometheus on your EKS cluster
15
16
16
-
This learning path uses `helm`to install prometheus on the Kubernetes cluster. Follow the [helm documentation](https://helm.sh/docs/intro/install/) to install it on your laptop.
17
+
You can use Helm to install prometheus on the Kubernetes cluster.
17
18
18
-
Create a namespace in your EKS cluster to host `prometheus` pods
19
+
Follow the [Helm documentation](https://helm.sh/docs/intro/install/) to install it on your computer.
20
+
21
+
Confirm Helm is installed by running the version command:
Login to the grafana dashboard using the LoadBalancer IP and click on `Dashboards` in the left navigation page. Locate a `Kubernetes / Compute Resources / Node` dashboard and click on it. You should see a dashboard like below for your Kubernetes cluster
106
+
Login to the grafana dashboard using the LoadBalancer IP and click on `Dashboards` in the left navigation page. Locate a `Kubernetes / Compute Resources / Node` dashboard and click on it.
107
+
108
+
You see a dashboard like below for your Kubernetes cluster:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/Monitoring with Elasticsearch and Kibana.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Monitoring the sentiments with Elasticsearch and Kibana
2
+
title: Monitoring sentiment with Elasticsearch and Kibana
3
3
weight: 4
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -8,11 +8,13 @@ layout: learningpathall
8
8
9
9
## Deploy Elasticsearch and Kibana on Arm-based EC2 instance
10
10
11
-
Elasticsearch is a NoSQL database and search & analytics engine. It's designed to store, search and analyze large amounts of data. It has real-time indexing capability which is crucial for handling high-velocity data streams like tweets. Kibana is a dashboard and visualization tool that integrates seamlessly with Elasticsearch. It provides an interface to interact with twitter data, apply filters and receive alerts. There are multiple ways to install Elasticsearch and Kibana, one of the methods is shown below.
11
+
Elasticsearch is a NoSQL database, search, and analytics engine. It's designed to store, search and analyze large amounts of data. It has real-time indexing capability which is crucial for handling high-velocity data streams like Tweets.
12
12
13
-
Before you begin, ensure that docker and docker compose have been installed on your laptop.
13
+
Kibana is a dashboard and visualization tool that integrates seamlessly with Elasticsearch. It provides an interface to interact with twitter data, apply filters, and receive alerts. There are multiple ways to install Elasticsearch and Kibana, one method is shown below.
14
14
15
-
Create the following docker-compose.yml file
15
+
Before you begin, ensure that Docker and Docker Compose have been installed on your computer.
16
+
17
+
Use a text editor to create a `docker-compose.yml` file with the contents below:
16
18
17
19
```yml
18
20
version: '2.18.1'
@@ -47,15 +49,18 @@ networks:
47
49
elk:
48
50
driver: bridge
49
51
```
52
+
50
53
Use the following command to deploy Elasticsearch and Kibana Dashboard.
51
54
55
+
```console
52
56
docker-compose up
57
+
```
53
58
54
59
After the dashboard is up, use the the public IP of your server on the port 5601 to access the Kibana dashboard.
55
60
56
61

57
62
58
-
Now switch to the stack management using the menu on the left side as shown in below image.
63
+
Switch to the stack management using the menu on the left side as shown in below image.
59
64
60
65

61
66
@@ -71,7 +76,7 @@ One of the sample dashboard structures looks as below, showing the records of di
Similarly, you can desgin and create dashboards to analyze a particular set of data. The screenshot below shows the dashboard designed for this learning path
79
+
Similarly, you can design and create dashboards to analyze a particular set of data. The screenshot below shows the dashboard designed for this learning path
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/Sentiment Analysis.md
+47-18Lines changed: 47 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,20 +8,38 @@ layout: learningpathall
8
8
9
9
## Before you begin
10
10
11
-
You will need an [AWS account](https://aws.amazon.com/). Create an account if needed.
11
+
You will need an [AWS account](https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html). Create an account if needed.
12
12
13
-
Three tools are required on your local machine. Follow the links to install the required tools.
13
+
Four tools are required on your local machine. Follow the links to install each tool.
14
14
15
15
*[Kubectl](/install-guides/kubectl/)
16
-
*[AWS CLI](/install-guides/aws-cli)
17
-
*[Docker](/install-guides/docker)
18
-
*[Terraform](/install-guides/terraform)
16
+
*[AWS CLI](/install-guides/aws-cli/)
17
+
*[Docker](/install-guides/docker/)
18
+
*[Terraform](/install-guides/terraform/)
19
+
20
+
To use the AWS CLI, you will need to generate AWS access keys and configure the CLI. Follow the [AWS Credentials](/install-guides/aws_access_keys/) install guide for instructions.
19
21
20
22
## Setup sentiment analysis
21
23
22
-
Clone this github [repository](https://github.com/koleini/spark-sentiment-analysis) on your local workstation. Navigate to `eks` directory and update the `variables.tf` file with your AWS region.
24
+
Take a look at the [GitHub repository](https://github.com/koleini/spark-sentiment-analysis) then clone it on your local computer:
Create a repository in Amazon ECR to store the docker images. You can also use Docker Hub.
62
82
63
-
The Spark repository contains a script to build the Docker image needed for running inside the Kubernetes cluster. Execute this script on your Arm-based laptop to build the arm64 image.
83
+
The Spark repository contains a script to build the container image you need to run inside the Kubernetes cluster.
84
+
85
+
Execute this script on your Arm-based computer to build the arm64 image.
64
86
65
87
In the current working directory, clone the `apache spark` github repository prior to building the image
Execute the `spark-submit` command within the Spark folder to deploy the application. The following commands will run the application with two executors, each with 12 cores, and allocate 24GB of memory for both the executors and driver pods.
82
106
83
-
Set the following variables before executing the `spark-submit` command
107
+
Set the following variables before executing the `spark-submit` command:
Create a twitter(X) [developer account](https://developer.x.com/en/docs/x-api/getting-started/getting-access-to-the-x-api) and create a `bearer token`. Using the following script to fetch the tweets
150
+
Create a twitter(X) [developer account](https://developer.x.com/en/docs/x-api/getting-started/getting-access-to-the-x-api) and create a `bearer token`.
151
+
152
+
Use the following commands to set the token and fetch the Tweets:
126
153
127
154
```console
128
155
export BEARER_TOKEN=<BEARER_TOKEN_FROM_X>
129
156
python3 scripts/xapi_tweets.py
130
157
```
131
158
132
-
You can modify the script `xapi_tweets.py` with your own keywords. Update the following section in the script to do so
159
+
You can modify the script `xapi_tweets.py` with your own keywords.
133
160
134
-
```console
161
+
Here is the code which includes the keywords:
162
+
163
+
```output
135
164
query_params = {'query': "(#onArm OR @Arm OR #Arm OR #GenAI) -is:retweet lang:en",
Sentiment analysis is a natural language processing technique used to identify and categorize opinions expressed in a piece of text, such as a tweet or a product review. It can help to gauge public opinion, identify trends and patterns, and improve decision-making. Social media platforms, such as Twitter, provide a wealth of information about public opinion, trends, and events. Sentiment analysis is important because it provides insights into how people feel about a particular topic or issue, and can help to identify emerging trends and patterns.
11
+
Sentiment analysis is a natural language processing technique used to identify and categorize opinions expressed in a piece of text, such as a tweet or a product review. It can help gauge public opinion, identify trends and patterns, and improve decision-making. Social media platforms, such as Twitter (X), provide a wealth of information about public opinion, trends, and events. Sentiment analysis is important because it provides insights into how people feel about a particular topic or issue, and can help to identify emerging trends and patterns.
12
12
13
+
## Can I perform real-time sentiment analysis using an Arm-based Amazon EKS cluster?
13
14
14
-
## Real-time sentiment analysis with Arm-based Amazon EKS clusters
15
+
Yes, you can use EKS for sentiment analysis.
15
16
16
-
Real-time sentiment analysis is a compute-intensive task and can quickly drive up resources and increase costs if not managed effectively. Tracking real-time changes enables organizations to understand sentiment patterns and make informed decisions promptly, allowing for timely and appropriate actions.
17
+
Real-time sentiment analysis is a compute-intensive task and can quickly drive up resources and increase costs if not managed effectively. Tracking real-time changes enables you to understand sentiment patterns and make informed decisions promptly, allowing for timely and appropriate actions.
18
+
19
+
The architecture used for the solution is shown below:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/sentiment-analysis-eks/_index.md
+11-8Lines changed: 11 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,22 @@
1
1
---
2
-
title: Learn how to perform Twitter(X) Sentiment Analysis on Arm-based EKS clusters
2
+
title: Learn how to perform Twitter (X) sentiment analysis on Arm-based EKS clusters
3
+
4
+
draft: true
5
+
cascade:
6
+
draft: true
3
7
4
8
minutes_to_complete: 60
5
9
6
-
who_is_this_for: This is an advanced topic for software developers who like to build an end-to-end solution ML solution to analyze the sentiments of live tweets with Arm-based Amazon EKS cluster
10
+
who_is_this_for: This is an advanced topic for software developers who want to build an end-to-end ML sentiment analysis solution to analyze live Tweets on an Arm-based Amazon EKS cluster.
7
11
8
12
learning_objectives:
9
-
- Deploy text classification model on Amazon EKS with Apache Spark
10
-
- Learn how to deploy Elasticsearch and Kibana dashboard to analyze the tweets
11
-
- Deploy Prometheus and Grafana dashboard to keep track of CPU and RAM usage of Kubernetes nodes
13
+
- Deploy a text classification model on Amazon EKS with Apache Spark.
14
+
- Use Elasticsearch and a Kibana dashboard to analyze the Tweets.
15
+
- Deploy Prometheus and Grafana dashboards to keep track of CPU and RAM usage of Kubernetes nodes.
12
16
13
17
prerequisites:
14
-
- An [AWS account](https://aws.amazon.com/). Create an account if needed.
15
-
- A computer with [Amazon eksctl CLI](/install-guides/eksctl) and [kubectl](/install-guides/kubectl/)installed.
16
-
- Docker installed on local computer [Docker](/install-guides/docker)
18
+
- An AWS account.
19
+
- A computer with Docker, Terraform, the Amazon eksctl CLI, and kubectl installed.
17
20
18
21
author_primary: Pranay Bakre, Masoud Koleini, Nobel Chowdary Mandepudi, Na Li
0 commit comments