This topic explains how to view the logs of a running Flink job and access its web UI.
Prerequisites
A Flink cluster has been created in the E-MapReduce on ACK console. For more information, see Quick Start.
View Flink job logs
-
Log on to the EMR on ACK console.
-
On the EMR on ACK page, find the target cluster and click the link in the ACK Cluster column.
-
On the Pods page, find the target pod and click Log in the Actions column.
You can then view the logs for the corresponding JobManager or TaskManager.
Access the Flink web UI
-
Connect to the Kubernetes cluster using kubectl. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
Alternatively, you can connect to the Kubernetes cluster using APIs. For more information, see Use the Kubernetes API.
-
Run the following command to forward the Flink JobManager service to a local port.
kubectl port-forward -n <yourClusterId> svc/basic-emr-example-rest 18088:8081NoteReplace the following parameters in the sample command:
-
<yourClusterId>: Your cluster ID. You can find this ID on the cluster management page in the E-MapReduce on ACK console. -
svc/basic-emr-example-rest: The name of your Flink job's service. You can run the commandkubectl get svc -n <yourClusterId>to view all Kubernetes services. Select the service with the name format <flink_deployment_name>-rest.
-
-
In a web browser, go to http://127.0.0.1:18088/#/overview to view the job's status.
The page shows 0 Available Task Slots, 2 Total Task Slots, and 1 Task Managers. The Running Jobs section shows 1 job. The Running Job List includes a job named State machine job with a status of RUNNING, and all four of its tasks are running.