BaşlayınÜcretsiz Başlayın

Start a cluster

Clusters oftentimes are configured to turn off and run in IDLE mode after being inactive for a certain period of time. We can use the clusters service of the Databricks SDK to run a cluster that exists in the authenticated workspace.

Bu egzersiz

Databricks with the Python SDK

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Store value of environment variable DATACAMP_CLUSTER_ID in a variable called cluster_id.
  • Start cluster with id stored in environment variable DATACAMP_CLUSTER_ID.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

w = WorkspaceClient()

# Store value of the environment variable as cluster_id
cluster_id = os.____['DATACAMP_CLUSTER_ID']

# Start cluster with id stored in cluster_id variable
try:
  w.clusters.start(____=cluster_id).result()
except:
  print(f"Cannot start cluster_id={cluster_id} because it is already running")
Kodu Düzenle ve Çalıştır