Skip to content

Commit 9c3f48b

Browse files
authored
Merge pull request #273370 from sreekzz/Flink-appmode-updates
Updated new screenshots
2 parents 7d5815f + bc3911b commit 9c3f48b

File tree

14 files changed

+72
-64
lines changed

14 files changed

+72
-64
lines changed

articles/hdinsight-aks/flink/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Apache Flink uses file systems to consume and persistently store data, both for
1616

1717
* [Apache Flink cluster on HDInsight on AKS ](../flink/flink-create-cluster-portal.md)
1818
* [Apache Kafka cluster on HDInsight](../../hdinsight/kafka/apache-kafka-get-started.md)
19-
* You're required to ensure the network settings are taken care as described on [Using Apache Kafka on HDInsight](../flink/process-and-consume-data.md); that's to make sure HDInsight on AKS and HDInsight clusters are in the same Virtual Network
19+
* You're required to ensure the network settings taken care as described on [Using Apache Kafka on HDInsight](../flink/process-and-consume-data.md). Make sure HDInsight on AKS and HDInsight clusters are in the same Virtual Network.
2020
* Use MSI to access ADLS Gen2
2121
* IntelliJ for development on an Azure VM in HDInsight on AKS Virtual Network
2222

@@ -126,8 +126,14 @@ public class KafkaSinkToGen2 {
126126
public static void main(String[] args) throws Exception {
127127
// 1. get stream execution env
128128
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
129+
130+
Configuration flinkConfig = new Configuration();
129131

130-
// 1. read kafka message as stream input, update your broker ip's
132+
flinkConfig.setString("classloader.resolve-order", "parent-first");
133+
134+
env.getConfig().setGlobalJobParameters(flinkConfig);
135+
136+
// 2. read kafka message as stream input, update your broker ip's
131137
String brokers = "<update-broker-ip>:9092,<update-broker-ip>:9092,<update-broker-ip>:9092";
132138
KafkaSource<String> source = KafkaSource.<String>builder()
133139
.setBootstrapServers(brokers)
@@ -161,18 +167,32 @@ public class KafkaSinkToGen2 {
161167

162168
```
163169

164-
**Submit the job on Flink Dashboard UI**
170+
**Package jar, and submit to Apache Flink.**
171+
172+
1. Upload the jar to ABFS.
173+
174+
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/app-mode.png" alt-text="Screenshot showing Flink app mode screen." lightbox="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/app-mode.png":::
175+
176+
177+
1. Pass the job jar information in `AppMode` cluster creation.
178+
179+
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/create-app-mode.png" alt-text="Screenshot showing create app mode." lightbox="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/create-app-mode.png":::
180+
181+
> [!NOTE]
182+
> Make sure to add classloader.resolve-order as ‘parent-first’ and hadoop.classpath.enable as `true`
183+
184+
1. Select Job Log aggregation to push job logs to storage account.
165185

166-
We are using Maven to package a jar onto local and submitting to Flink, and using Kafka to sink into ADLS Gen2.
186+
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/enable-job-log.png" alt-text="Screenshot showing how to enable job log." lightbox="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/enable-job-log.png":::
167187

168-
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/submit-flink-job.png" alt-text="Diagram showing how to submit Flink Job." border="true" lightbox="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/submit-flink-job.png":::
188+
1. You can see the job running.
169189

170-
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/submit-the-job-flink-ui.png" alt-text="Screenshot showing jar submission to Flink dashboard.":::
190+
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/flink-ui.png" alt-text="Screenshot showing Flink UI." lightbox="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/flink-ui.png":::
171191

172192

173193
**Validate streaming data on ADLS Gen2**
174194

175-
We are seeing the `click_events` streaming into ADLS Gen2
195+
We're seeing the `click_events` streaming into ADLS Gen2.
176196

177197
:::image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/validate-stream-azure-data-lake-storage-gen2-1.png" alt-text="Screenshot showing ADLS Gen2 output.":::
178198
:::Image type="content" source="./media/assign-kafka-topic-event-message-to-azure-data-lake-storage-gen2/validate-stream-azure-data-lake-storage-gen2-2.png" alt-text="Screenshot showing Flink click event output.":::

articles/hdinsight-aks/flink/flink-configuration-management.md

Lines changed: 45 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
---
22
title: Apache Flink® Configuration Management in HDInsight on AKS
3-
description: Learn about Apache Flink Configuration Management in HDInsight on AKS
3+
description: Learn about Apache Flink Configuration Management in HDInsight on AKS.
44
ms.service: hdinsight-aks
55
ms.topic: tutorial
6-
ms.date: 08/29/2023
6+
ms.date: 04/25/2024
77
---
88

99
# Apache Flink® Configuration management in HDInsight on AKS
1010

1111
[!INCLUDE [feature-in-preview](../includes/feature-in-preview.md)]
1212

13-
HDInsight on AKS provides a set of default configurations of Apache Flink for most properties and a few based on common application profiles. However, in case you're required to tweak Flink configuration properties to improve performance for certain applications with state usage, parallelism, or memory settings, you can change certain properties at cluster level using **Configuration management** section in HDInsight on AKS cluster.
13+
HDInsight on AKS provides a set of default configurations of Apache Flink for most properties and a few based on common application profiles. However, in case you're required to tweak Flink configuration properties to improve performance for certain applications with state usage, parallelism, or memory settings, you can change Flink job configuration using Flink Jobs Section in HDInsight on AKS cluster.
1414

15-
1. Go to **Configuration Management** section on your Apache Flink cluster page
15+
1. Go To Settings > Flink Jobs > Click on Update.
1616

17-
:::image type="content" source="./media/flink-configuration-management/configuration-page-revised.png" alt-text="Screenshot showing Apache Flink Configuration Management page." lightbox="./media/flink-configuration-management/configuration-page-revised.png":::
17+
:::image type="content" source="./media/flink-configuration-management/update-page.png" alt-text="Screenshot showing update page." lightbox="./media/flink-configuration-management/update-page.png":::
1818

19-
2. Update **configurations** as required at *Cluster level*
19+
1. Click on **+ Add a row** to edit configuration.
2020

21-
:::image type="content" source="./media/flink-configuration-management/update-configuration-revised.png" alt-text="Screenshot showing Apache Flink Update configuration page." lightbox="./media/flink-configuration-management/update-configuration-revised.png":::
21+
:::image type="content" source="./media/flink-configuration-management/update-job.png" alt-text="Screenshot update job." lightbox="./media/flink-configuration-management/update-job.png":::
2222

23-
Here the checkpoint interval is changed at *Cluster level*.
24-
25-
3. Update the changes by clicking **OK** and then **Save**.
26-
27-
Once saved, the new configurations get updated in a few minutes (~5 minutes).
28-
29-
Configurations, which can be updated using Configuration Management Settings
30-
31-
`processMemory size:`
32-
33-
The default settings for the process memory size of or job manager and task manager would be the memory configured by the user during cluster creation.
34-
35-
This size can be configured by using the below configuration property. In-order to change task manager process memory, use this configuration
36-
37-
`taskmanager.memory.process.size : <value>`
38-
39-
Example:
40-
`taskmanager.memory.process.size : 2000mb`
41-
42-
For job manager,
43-
44-
`jobmanager.memory.process.size : <value>`
45-
46-
> [!NOTE]
47-
> The maximum configurable process memory is equal to the memory configured for `jobmanager/taskmanager`.
23+
Here the checkpoint interval is changed at *Cluster level*.
24+
25+
1. Update the changes by clicking **OK** and then **Save**.
26+
27+
1. Once saved, the new configurations get updated in a few minutes (~5 minutes).
28+
29+
1. Configurations, which can be updated using Configuration Management Settings.
30+
31+
`processMemory size:`
32+
33+
1. The default settings for the process memory size of or job manager and task manager would be the memory configured by the user during cluster creation.
34+
35+
1. This size can be configured by using the below configuration property. In-order to change task manager process memory, use this configuration.
36+
37+
`taskmanager.memory.process.size : <value>`
38+
39+
Example:
40+
`taskmanager.memory.process.size : 2000mb`
41+
42+
1. For job manager
43+
44+
`jobmanager.memory.process.size : <value>`
45+
46+
> [!NOTE]
47+
> The maximum configurable process memory is equal to the memory configured for `jobmanager/taskmanager`.
4848
4949
## Checkpoint Interval
5050

51-
The checkpoint interval determines how often Flink triggers a checkpoint. it's defined in milliseconds and can be set using the following configuration property:
51+
The checkpoint interval determines how often Flink triggers a checkpoint. Defined in milliseconds and can be set using the following configuration property
5252

5353
`execution.checkpoint.interval: <value>`
5454

5555
Default setting is 60,000 milliseconds (1 min), this value can be changed as desired.
5656

5757
## State Backend
5858

59-
The state backend determines how Flink manages and persists the state of your application. It impacts how checkpoints are stored. You can configure the `state backend using the following property:
59+
The state backend determines how Flink manages and persists the state of your application. It impacts how checkpoints stored. You can configure the `state backend using the following property:
6060

6161
`state.backend: <value>`
6262

63-
By default Apache Flink clusters in HDInsight on AKS use Rocks db
63+
By default Apache Flink clusters in HDInsight on AKS use Rocks DB.
6464

6565
## Checkpoint Storage Path
6666

6767
We allow persistent checkpoints by default by storing the checkpoints in `abfs` storage as configured by the user. Even if the job fails, since the checkpoints are persisted, it can be easily started with the latest checkpoint.
6868

6969
`state.checkpoints.dir: <path>`
70-
Replace `<path>` with the desired path where the checkpoints are stored.
70+
Replace `<path>` with the desired path where the checkpoints stored.
7171

72-
By default, it's stored in the storage account (ABFS), configured by the user. This value can be changed to any path desired as long as the Flink pods can access it.
72+
By default, stored in the storage account (ABFS), configured by the user. This value can be changed to any path desired as long as the Flink pods can access it.
7373

7474
## Maximum Concurrent Checkpoints
7575

@@ -88,40 +88,28 @@ Replace `<value>` with desired maximum number. By default we retain maximum five
8888

8989
We allow persistent savepoints by default by storing the savepoints in `abfs` storage (as configured by the user). If the user wants to stop and later start the job with a particular savepoint, they can configure this location.
9090
state.checkpoints.dir: `<path>`
91-
Replace` <path>` with the desired path where the savepoints are stored.
92-
By default, it's stored in the storage account, configured by the user. (We support ABFS). This value can be changed to any path desired as long as the Flink pods can access it.
91+
Replace` <path>` with the desired path where the savepoints stored.
92+
By default, stored in the storage account, configured by the user. (We support ABFS). This value can be changed to any path desired as long as the Flink pods can access it.
9393

9494
## Job manager high availability
9595

96-
In HDInsight on AKS, Flink uses Kubernetes as backend. Even if the Job Manager fails in between due to any known/unknown issue, the pod is restarted within a few seconds. Hence, even if the job restarts due to this issue, the job is recovered back from the **latest checkpoint**.
96+
In HDInsight on AKS, Flink uses Kubernetes as backend. Even if the Job Manager fails in between due to any known/unknown issue, the pod is restarted within a few seconds. Hence, even if the job restarts due to this issue, the job is recovered back from the **latest checkpoint**.
9797

9898
### FAQ
9999

100-
**Why does the Job failure in between
100+
**Why does the Job failure in between.
101101
Even if the jobs fail abruptly, if the checkpoints are happening continuously, then the job is restarted by default from the latest checkpoint.**
102102

103103
Change the job strategy in between?
104104
There are use cases, where the job needs to be modified while in production due to some job level bug. During that time, the user can stop the job, which would automatically take a savepoint and save it in savepoint location.
105105

106-
`bin/flink stop <JOBID>`
107-
108-
Example:
109-
110-
```
111-
root [ ~ ]# ./bin/flink stop 60bdf21d9bc3bc65d63bc3d8fc6d5c54
112-
Suspending job "60bdf21d9bc3bc65d63bc3d8fc6d5c54" with a CANONICAL savepoint.
113-
Savepoint completed. Path: abfs://[email protected]/8255a11812144c28b4ddf1068460c96b/savepoints/savepoint-60bdf2-7717485d15e3
114-
```
106+
1. Click on `savepoint` and wait for `savepoint` to be completed.
115107

116-
Later the user can start the job with bug fix pointing to the savepoint.
108+
:::image type="content" source="./media/flink-configuration-management/save-point.png" alt-text="Screenshot showing save point options." lightbox="./media/flink-configuration-management/save-point.png":::
117109

118-
```
119-
./bin/flink run <JOB_JAR> -d <SAVEPOINT_LOC>
120-
root [ ~ ]# ./bin/flink run examples/streaming/StateMachineExample.jar -s abfs://[email protected]/8255a11812144c28b4ddf1068460c96b/savepoints/savepoint-60bdf2-7717485d15e3
121-
```
122-
Usage with built-in data generator: StateMachineExample [--error-rate `<probability-of-invalid-transition>] [--sleep <sleep-per-record-in-ms>]`
110+
1. After savepoint completion, click on start and Start Job Tab will appear. Select the savepoint name from the dropdown. Edit any configurations if necessary. And click **OK**.
123111

124-
Usage with Kafka: `StateMachineExample --kafka-topic <topic> [--brokers <brokers>]`
112+
:::image type="content" source="./media/flink-configuration-management/start-job.png" alt-text="Screenshot showing how to start job." lightbox="./media/flink-configuration-management/start-job.png":::
125113

126114
Since savepoint is provided in the job, the Flink knows from where to start processing the data.
127115

52.7 KB
Loading
Loading
Loading
Loading
68.8 KB
Loading

0 commit comments

Comments
 (0)