This topic describes how to view the logs of a running Flink job and access the web user interface (UI) of the job.
Prerequisites
A Flink cluster is created on the EMR on ACK page of the E-MapReduce (EMR) console. For more information, see Getting started.
View the logs of a Flink job
Log on to the EMR on ACK console.
On the EMR on ACK page, find the Flink cluster that you want to manage and click the name of the Container Service for Kubernetes (ACK) cluster in the ACK Cluster column.
On the Pods page, find the pod that you want to mangae and click Logs in the Actions column.
You can view the JobManager or TaskManager logs of your Flink job.
Access the web UI of a Flink job
- Connect to an Alibaba Cloud Container Service for Kubernetes (ACK) cluster by using kubectl. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster. You can also connect to the ACK cluster by calling an API operation. For more information, see Use the Kubernetes API.
Run the following command to forward a port on your on-premises machine to a port of the Service on which your Flink job runs. This way, you can access the Service from your on-premises machine.
kubectl port-forward -n <yourClusterId> svc/basic-emr-example-rest 18088:8081
NoteThe sample code of the command is only for reference. You must replace the following variables with actual values:
<yourClusterId>
: the ID of the Flink cluster. You can obtain the cluster ID on the EMR on ACK page of the EMR console.svc/basic-emr-example-rest
: the name of the Service on which the Flink job runs. You can run thekubectl get svc -n <yourClusterId>
command to query all Kubernetes Services in the Flink cluster. Specify the name of the Service in the <flink_deployment_name>-rest format for port forwarding.
Visit http://127.0.0.1:18088/#/overview by using your browser to view the status of the Flink job.