Obtains the logs that are related to Spark job attempts.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetJobAttemptLog

The operation that you want to perform. Set the value to GetJobAttemptLog.

JobAttemptId String Yes j202105272322hangzhou5d64f1560000128-0001

The ID of the Spark job attempt.

JobId String Yes j202105272322hangzhou5d64f1560000128

The ID of the Spark job. You can view the ID on the Parameter Configuration page.

VcName String Yes release-test

The name of the virtual cluster (VC) on which the job runs. You can view the name on the Virtual Cluster management page.

Response parameters

Parameter Type Example Description
Data String local:///opt/spark/jars/offline-sql.jar, main_file\n+ exec /usr/bin/tini -s -- /jdk/jdk8/bin/java -cp '/opt/tools/exec-wrapper.jar:.:::/opt/spark/jars/*' com.aliyun.dla.spark.SparkJobWrapper /opt/spark/bin/spark-submit --conf spark.driver.host=172.16.6.205 --conf spark.ui.port=4040 --conf 'spark.driver.extraJavaOptions=-Dlog4j.configuration=file:///opt/spark/log-conf/log4j.properties -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/dump.hprof -XX:OnOutOfMemoryError=\"bash /opt/tools/oss-cp.sh /tmp/dump.hprof oss://dla-test-cn-hangzhou/spark-logs/release-test/j202105272322hangzhou5d64f1560000128-0001/driver/dump.hprof; bash /opt/tools/job-stop.sh\" '

The returned log.

RequestId String 9CE8F271-F918-43B6-8F58-F9F1C2DCFDB8

The unique ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=GetJobAttemptLog
&JobAttemptId=j202105272322hangzhou5d64f1560000128-0001
&JobId=j202105272322hangzhou5d64f1560000128
&VcName=release-test
&<Common request parameters>

Sample success responses

XML format

<RequestId>9CE8F271-F918-43B6-8F58-F9F1C2DCFDB8</RequestId>
<Data>local:///opt/spark/jars/offline-sql.jar, main_file\n+ exec /usr/bin/tini -s -- /jdk/jdk8/bin/java -cp '/opt/tools/exec-wrapper.jar:.:::/opt/spark/jars/*' com.aliyun.dla.spark.SparkJobWrapper /opt/spark/bin/spark-submit --conf spark.driver.host=172.16.6.205 --conf spark.ui.port=4040 --conf 'spark.driver.extraJavaOptions=-Dlog4j.configuration=file:///opt/spark/log-conf/log4j.properties -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/dump.hprof -XX:OnOutOfMemoryError=\"bash /opt/tools/oss-cp.sh /tmp/dump.hprof oss://dla-test-cn-hangzhou/spark-logs/release-test/j202105272322hangzhou5d64f1560000128-0001/driver/dump.hprof; bash /opt/tools/job-stop.sh\" '</Data>

JSON format

{"RequestId":"9CE8F271-F918-43B6-8F58-F9F1C2DCFDB8","Data":"local:///opt/spark/jars/offline-sql.jar, main_file\\n+ exec /usr/bin/tini -s -- /jdk/jdk8/bin/java -cp '/opt/tools/exec-wrapper.jar:.:::/opt/spark/jars/*' com.aliyun.dla.spark.SparkJobWrapper /opt/spark/bin/spark-submit --conf spark.driver.host=172.16.6.205 --conf spark.ui.port=4040 --conf 'spark.driver.extraJavaOptions=-Dlog4j.configuration=file:///opt/spark/log-conf/log4j.properties -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp/dump.hprof -XX:OnOutOfMemoryError=\\\"bash /opt/tools/oss-cp.sh /tmp/dump.hprof oss://dla-test-cn-hangzhou/spark-logs/release-test/j202105272322hangzhou5d64f1560000128-0001/driver/dump.hprof; bash /opt/tools/job-stop.sh\\\" '"}

Error codes

For a list of error codes, visit the API Error Center.