Removing the Faulty TaskManager During Flink Restart
Scenarios
If a Flink job fails due to a disk fault on the node where the TaskManager is located, the job cannot be recovered even if the restart mechanism is triggered. As a result, the job may fail or is restarted infinitely.
Flink restarts the failed Flink job upon a failure. When a TaskManager is faulty, the job is automatically restarted to prevent services from being adversely affected. During the job restart, the system places the failed TaskManager in an idle resource pool and preferentially uses the idle TaskManager.
After this feature is enabled, a new TaskManager will be requested when a Flink job fails and restarts, implementing fault recovery. In addition, you are advised to reduce the idle release time of the TaskManager. For example, set the following parameters on the Customized Parameter tab page of the Flink job development page by referring to Creating a FlinkServer Job.
- Set resourcemanager.taskmanager-timeout (TaskManager idle timeout interval) to 60s.
- Set execution.checkpointing.tolerable-failed-checkpoints (number of allowed consecutive checkpoint failures) to 5.
Notes and Constraints
- This section applies only to MRS 3.6.0-LTS and later.
- This feature must be used together with the Flink job restart policy. For details, see Configuring the Flink Job Restart Policy.
- When a large number of TaskManagers of Flink jobs fail, a large number of resources are requested in a short period of time. The failed TaskManagers do not release occupied resources immediately (the resources are released only after the idle timeout expires). As a result, the cluster resource usage decreases.
- Abnormal TaskManagers can be removed only in cases of disk failures.
- Batch job scenarios are not supported.
Prerequisites
You have created a user, for example, flink_admin, assigned with the FlinkServer Admin Privilege for accessing the Flink web UI. For details about how to create a FlinkServer user, see Creating a FlinkServer Role.
Procedure
- Configure a proper Flink job restart strategy by referring to Configuring the Flink Job Restart Policy based on your service scenario.
- Log in to FusionInsight Manager as a user with the FlinkServer administrator permissions. Choose Cluster > Services > Flink. On the right of Flink Web UI, click the link to access the Flink web UI.
- Click Job Management. The job management page is displayed.
- On the FlinkServer job management page, select an existing job or create a job by referring to Creating a FlinkServer Job, and go to the job development page.
- On the job development page, click Customized Parameter and set resourcemanager.block-tm-on-failure.enabled to true to enable the removal of abnormal TaskManagers. Then submit the Flink job for the configuration to take effect. Figure 1 Customized parameters
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot