共用方式為


實例集區 CLI (舊版)

重要

此檔已淘汰,且可能未更新。

此資訊適用于舊版 Databricks CLI 0.18 版和更新版本。 Databricks 建議您改用較新的 Databricks CLI 0.205 版或更新版本。 請參閱 什麼是 Databricks CLI? 。 若要尋找 Databricks CLI 的版本,請執行 databricks -v

若要從 Databricks CLI 0.18 版或更新版本移轉至 Databricks CLI 0.205 版或更新版本,請參閱 Databricks CLI 移轉

注意

集區 CLI 需要 Databricks CLI 0.9.0 或更新版本。

您會將子命令附加至 來執行 databricks instance-pools 子命令。 這些子命令會呼叫 實例集區 API

databricks instance-pools -h
Usage: databricks instance-pools [OPTIONS] COMMAND [ARGS]...

  Utility to interact with Databricks instance pools.

Options:
  -v, --version  [VERSION]
  -h, --help     Show this message and exit.

Commands:
  create           Creates a Databricks instance pool.
    Options:
      --json-file PATH         File containing JSON request to POST to /api/2.0/cluster-pools/create.
      --json JSON              JSON string to POST to /api/2.0/cluster-pools/create.
  delete           Deletes a Databricks instance pool.
    Options:
  get              Retrieves metadata about an instance pool.
    Options:
      --instance-pool-id INSTANCE_POOL_ID Can be found in the URL at https://<databricks-instance>/?o=<16-digit-number>#/setting/clusters/instance-pools/view/$INSTANCE_POOL_ID.
  list             Lists active instance pools with the stats of the pools.
    Options:
      --output FORMAT          JSON or TABLE. Set to TABLE by default.
  edit            Edits a Databricks instance pool
    Options:
      --json-file PATH         File containing JSON request to POST to /api/2.0/cluster-pools/create.
      --json JSON              JSON string to POST to /api/2.0/cluster-pools/create.

建立執行個體集區

若要顯示使用方式檔,請執行 databricks instance-pools create --help

databricks instance-pools create --json-file create-instance-pool.json

create-instance-pool.json

{
  "instance_pool_name": "my-pool",
  "node_type_id": "Standard_D3_v2",
  "min_idle_instances": 10
}
{
  "instance_pool_id": "1234-567890-binds123-pool-abcDe4fG"
}

刪除執行個體集區

若要顯示使用方式檔,請執行 databricks instance-pools delete --help

databricks instance-pools delete --instance-pool-id 1234-567890-binds123-pool-abcDe4fG

如果成功,就不會顯示任何輸出。

取得實例集區的相關資訊

若要顯示使用方式檔,請執行 databricks instance-pools get --help

databricks instance-pools get --instance-pool-id 1234-567890-binds123-pool-abcDe4fG
{
  "instance_pool_name": "My Pool",
  "min_idle_instances": 2,
  "node_type_id": "Standard_F16s",
  "idle_instance_autotermination_minutes": 4320,
  "enable_elastic_disk": true,
  "preloaded_spark_versions": [
    "5.5.x-scala2.11"
  ],
  "azure_attributes": {
    "availability": "ON_DEMAND_AZURE"
  },
  "instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
  "default_tags": {
    "Vendor": "Databricks",
    "DatabricksInstancePoolCreatorId": "123456789012345",
    "DatabricksInstancePoolId": "1234-567890-binds123-pool-abcDe4fG",
    "DatabricksInstanceGroupId": "-2345678901234567890"
  },
  "state": "ACTIVE",
  "stats": {
    "used_count": 0,
    "idle_count": 2,
    "pending_used_count": 0,
    "pending_idle_count": 0
  },
  "status": {}
}

列出可用實例集區的相關資訊

若要顯示使用方式檔,請執行 databricks instance-pools list --help

databricks instance-pools list --output JSON
{
  "instance_pools": [
    {
      "instance_pool_name": "My Pool",
      "min_idle_instances": 2,
      "node_type_id": "Standard_F16s",
      "idle_instance_autotermination_minutes": 4320,
      "enable_elastic_disk": true,
      "preloaded_spark_versions": [
        "5.5.x-scala2.11"
      ],
      "azure_attributes": {
        "availability": "ON_DEMAND_AZURE"
      },
      "instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
      "default_tags": {
        "Vendor": "Databricks",
        "DatabricksInstancePoolCreatorId": "123456789012345",
        "DatabricksInstancePoolId": "1234-567890-binds123-pool-abcDe4fG",
        "DatabricksInstanceGroupId": "-2345678901234567890"
      },
      "state": "ACTIVE",
      "stats": {
        "used_count": 0,
        "idle_count": 2,
        "pending_used_count": 0,
        "pending_idle_count": 0
      },
      "status": {}
    },
    ...
  ]
}

變更實例集區的設定

若要顯示使用方式檔,請執行 databricks instance-pools edit --help

databricks instance-pools edit --json-file edit-instance-pool.json

edit-instance-pool.json

{
  "instance_pool_name": "My Pool",
  "instance_pool_id": "1234-567890-binds123-pool-abcDe4fG",
  "min_idle_instances": 15
}

如果成功,就不會顯示任何輸出。