Exporting Logs
- In Saving Run Logs to a Local PC, you can obtain only the logs of the driver on the local node, not the logs of the entire task. You can run the following command to obtain the logs of the entire task:
yarn logs -applicationId
- Obtain the task ID using either of the following methods (the second recommended):
- If the history server is started, you can run the following command to query the task list to obtain the task ID:
yarn application -list
- When a large number of tasks are executed, it is difficult to identify which task is the target one. In this case, you can run the following command to obtain the task ID based on the log obtained in Saving Run Logs to a Local PC:
cat /home/test/boostkit/spark_algorithm.log |grep "Submitting application"
- If the history server is started, you can run the following command to query the task list to obtain the task ID:
- Export task logs to the local PC.For example, if the task ID is application_XXX_XXX, you can run the following command to export the logs of the entire task:
yarn logs -applicationId application_XXX_XXX > /home/test/boostkit/all.log
- Run the following command to export the logs of the machine learning algorithm library:
cat /home/test/boostkit/all.log |grep KunpengAlgorithmLibrary > ml.log
- In the preceding command, ml.log is the last exported log file. The log file name can be changed based on your requirements. In this example, ml.log is used.
- The logs of the machine learning algorithm library are integrated with the logs of the native Spark algorithm. When an error occurs in the library, locate and analyze the fault together with the logs of the native Spark algorithm.
Parent topic: Log Management