You can easily submit, monitor, and control jobs on Dataproc clusters using the gcloud command-line tool, the Google Cloud Console, or the Cloud Dataproc REST API. When you use one of these mechanisms to submit your job, Cloud Dataproc automatically gathers the driver (console) output from your job, and makes it available to you. This means you can quickly review driver output without having to maintain a connection to the cluster while your jobs run or look through complicated log files.
By default, Cloud Dataproc uses a default
WARN for driver programs. This setting can be adjusted when using the
command line, which allows you submit a job with the
root package controls the root logger level. For example:
gcloud dataproc jobs submit hadoop ...\ --driver-log-levels root=FATAL,com.example=INFO
Logging can be set at a more granular level for each job. For example, to assist in debugging issues
when reading files from Cloud Storage, you can submit a job with the
option, specifying the
DEBUG log level as follows:
gcloud dataproc jobs submit hadoop ...\ --driver-log-levels com.google.cloud.hadoop.gcsio=DEBUG
Accessing job driver output
You can access Cloud Dataproc job driver output using the Cloud Console,
gcloud command-line tool, or Cloud Storage.
When you submit a job with the
gcloud dataproc jobs submit
command, the job's driver output is displayed on the console. You can "rejoin"
driver output at a later time, on a different computer, or in
a new window by passing your job's ID to the
gcloud dataproc jobs wait
command. The Job ID is a
5c1754a5-34f7-4553-b667-8a1199cb9cab. Here's an example.
gcloud dataproc jobs wait 5c1754a5-34f7-4553-b667-8a1199cb9cab \ --project my-project-id --region my-cluster-region
Waiting for job output... ... INFO gcs.GoogleHadoopFileSystemBase: GHFS version: 1.4.2-hadoop2 ... 16:47:45 INFO client.RMProxy: Connecting to ResourceManager at my-test-cluster-m/ ...
To view job driver output, go to your project's Dataproc Jobs section, then click on the Job ID to view job output.
If the job is running, the job driver output periodically refreshes with new content.
Job driver output is stored in Cloud Storage in either the staging bucket or the bucket you specified when you created your cluster. A link to job driver output in Cloud Storage is provided in the Job.driverOutputResourceUri field returned by: