Help Center/ MapReduce Service/ Troubleshooting/ Using Spark/ Failed to Switch to the Log Page from stderr and stdout on the Native Spark2x Page
Updated on 2023-09-05 GMT+08:00

Failed to Switch to the Log Page from stderr and stdout on the Native Spark2x Page

Issue

When Spark tasks are executed in an MRS 3.x cluster, stderr and stdout on the native Spark2x page cannot redirect to the log page.

Symptom

When Spark tasks are executed in an MRS 3.x cluster, stderr and stdout on the native Spark2x page cannot redirect to the log page.

Cause Analysis

The spark.httpdProxy.enable configuration item is not enabled.

Procedure (Modifying Configuration Items)

  1. On the client, set spark.httpdProxy.enable of the spark-defaults.conf configuration item to true. The default value is false.
  2. Log in to Manager, choose Cluster > Services > Spark2x. On the Spark2x page, choose Configurations > All Configurations > JobHistory2x > Customization. Locate the custom parameter in the right pane, add configuration item spark.httpdProxy.enable, and set the value to true.

    Figure 1 Customizing a configuration item

  3. By referring to step 2, add configuration item spark.httpdProxy.enable and set the value to true respectively for JDBCServer2x and SparkResource2x.
  4. Save the configuration. In the upper right corner of the Spark2x page, click More and select Service Rolling Restart.

    Figure 2 Rolling restarting Spark2x

  5. Log in to the native Spark2x page and click stdout or stderr to access the executor log page.

Procedure (Without Modifying Configuration Items)

  • View the logs of completed tasks.

    On the native Spark2x page, click AggregatedLogs to view the aggregated task logs.

    Figure 3 AggregatedLogs
  • View the logs of running tasks.

    On the native Spark2x page, choose Jobs > Stage > Task to locate the target executor and then click stdout or stderr to view logs of the executor.

    Figure 4 Jobs
    Figure 5 Stage
    Figure 6 Task

Related Information

After you click stdout or stderr to go to the log page, only stdout or stderr logs are displayed. To view complete logs, you can delete stdout or stderr from the URL and then access all logs of the executor.

Example URL for accessing stderr logs: https://<EIP>:9022/component/Yarn/NodeManager/15/node/containerlogs/container_e04_1627976981617_0002_01_000002/root/stderr?start=-4096

You can modify the URL as follows:

https://<EIP>:9022/component/Yarn/NodeManager/15/node/containerlogs/container_e04_1627976981617_0002_01_000002/root/?start=-4096

Then you can view all logs of the executor.

Figure 7 All log files