集群CLI(遺留)

重要的

這個文檔已經退休了,可能不會被更新。

這個信息適用於遺留磚CLI版本0.17和更低的。磚建議你改用新的磚CLI的版本0.200或更高版本。看到磚CLI。找到你的版本的磚CLI,運行- v

遺留在磚磚CLI不可用的穀歌雲。

你跑磚集群CLI子命令通過添加集群。這些子命令調用集群API

磚集群- h
用法:磚集群[選項]命令(ARGS)……效用與磚集群。選項:- v、——版本(版本)- h,幫助顯示此消息並退出。命令:創建集群創建一個磚。選項:- JSON文件路徑包含JSON請求的文件發布/ api / 2.0 /集群/創建。——json json json字符串發布/ api / 2.0 /集群/創建。刪除刪除一個磚集群。選項:——cluster-id CLUSTER_ID可以在URL https:// < databricks-instance > / ? o = < 16-digit-number > # /設置/集群/ CLUSTER_ID美元/配置。編輯編輯一個磚集群。選項:- JSON文件路徑包含JSON請求的文件發布/ api / 2.0 /集群/編輯。 --json JSON JSON string to POST to /api/2.0/clusters/edit. events Gets events for a Spark cluster. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///#/setting/clusters/$CLUSTER_ID/configuration. [required] --start-time TEXT The start time in epoch milliseconds. If unprovided, returns events starting from the beginning of time. --end-time TEXT The end time in epoch milliseconds. If unprovided, returns events up to the current time --order TEXT The order to list events in; either ASC or DESC. Defaults to DESC (most recent first). --event-type TEXT An event types to filter on (specify multiple event types by passing the --event-type option multiple times). If empty, all event types are returned. --offset TEXT The offset in the result set. Defaults to 0 (no offset). When an offset is specified and the results are requested in descending order, the end_time field is required. --limit TEXT The maximum number of events to include in a page of events. Defaults to 50, and maximum allowed value is 500. --output FORMAT can be "JSON" or "TABLE". Set to TABLE by default. get Retrieves metadata about a cluster. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration. list Lists active and recently terminated clusters. Options: --output FORMAT JSON or TABLE. Set to TABLE by default. list-node-types Lists node types for a cluster. list-zones Lists zones where clusters can be created. permanent-delete Permanently deletes a cluster. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration. resize Resizes a Databricks cluster given its ID. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration. --num-workers INTEGER Number of workers. [required] restart Restarts a Databricks cluster. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration. spark-versions Lists possible Databricks Runtime versions. start Starts a terminated Databricks cluster. Options: --cluster-id CLUSTER_ID Can be found in the URL at https:///?o=<16-digit-number>#/setting/clusters/$CLUSTER_ID/configuration.

創建一個集群

顯示使用文檔,運行集群創建——幫助

磚集群的創建,json文件create-cluster.json

create-cluster.json:

{“cluster_name”:“memoptimized-cluster-1”,“spark_version”:“7.5.x-scala2.12”,“spark_conf”:{},“gcp_attributes”:{“use_preemptible_executors”:},“node_type_id”:“n1-highmem-4”,“driver_node_type_id”:“n1-highmem-4”,“ssh_public_keys”:[],“custom_tags”:{},“spark_env_vars”:{“PYSPARK_PYTHON”:“磚/ python3 / bin / python3”},“autotermination_minutes”:120年,“enable_elastic_disk”:,“cluster_source”:“API”,“init_scripts”:[]}
{“cluster_id”:“1234 - 567890 batch123”}

刪除一個集群

顯示使用文檔,運行集群刪除——幫助

刪除——cluster-id磚集群1234年567890 - batch123

如果成功,沒有顯示輸出。

改變一個集群的配置

顯示使用文檔,運行集群編輯——幫助

磚集群的編輯——json文件edit-cluster.json

edit-cluster.json:

{“cluster_id”:“1234 - 567890 batch123”,“num_workers”:10,“spark_version”:“7.3.x-scala2.12”,“node_type_id”:“n1-standard-4”}

如果成功,沒有顯示輸出。

集群事件列表

顯示使用文檔,運行集群事件——幫助

磚集群事件\——cluster-id1234年567890 - batch123\——啟動時間1617238800000\——世界末日1619485200000\——訂單DESC\——限製5\——事件類型的運行\——JSON輸出\|金橋。
{“事件”:[{“cluster_id”:“1234 - 567890 batch123”,“時間戳”:1619214150232,“類型”:“運行”,"詳細信息":{“current_num_workers”: 2“target_num_workers”: 2}},{“cluster_id”:“1234 - 567890 batch123”,“時間戳”:1617895221986,“類型”:“運行”,"詳細信息":{“current_num_workers”: 2“target_num_workers”: 2}})," next_page ": {“cluster_id”:“1234 - 567890 batch123”,“start_time”: 1617238800000,“end_time”: 1619485200000,“訂單”:“DESC”,“event_types”:(“運行”),“抵消”:5“限製”:5},“total_count”: 11}

獲得一個集群信息

顯示使用文檔,運行集群得到——幫助

磚集群——cluster-id1234年567890 - batch123

或者:

磚集群,集群名稱my-cluster
{“cluster_id”:“1234 - 567890 batch123”,"司機":{" node_aws_attributes ": {“is_spot”:假的},:“private_ip 127.0.0.1”},:“cluster_name my-cluster”,:“spark_version 8.1.x-scala2.12”,:“node_type_id n1-standard-4”,:“driver_node_type_id n1-standard-4”,“autotermination_minutes”: 120年,“enable_elastic_disk”:假的,“disk_spec”: {},“cluster_source”:“API”,“enable_local_disk_encryption”:假的," gcp_attributes ": {“use_preemptible_executors”:假的}," instance_source ": {:“node_type_id n1-standard-4”}," driver_instance_source ": {:“node_type_id n1-standard-4”},“狀態”:“終止”,:“state_message集群終止活動”,“start_time”: 1619478205710,“terminated_time”: 1619487451280,“last_state_loss_time”: 1619478205710,"自動定量":{“min_workers”: 2“max_workers”: 8},“creator_user_name”:“someone@example.com”," termination_reason ": {“代碼”:“不活躍”,“參數”:{“inactivity_duration_min”:“120”},“類型”:“成功”},“init_scripts_safe_mode”:假的}

列出所有可用的集群信息

顯示使用文檔,運行集群列表——幫助

磚集群列表——JSON輸出|金橋。
{“集群”:({“cluster_id”:“1234 - 567890 batch123”,"司機":{" node_aws_attributes ": {“is_spot”:假的},:“private_ip 127.0.0.1”},:“cluster_name my-cluster”,:“spark_version 8.1.x-scala2.12”,:“node_type_id n1-standard-4”,:“driver_node_type_id n1-standard-4”,“autotermination_minutes”: 120年,“enable_elastic_disk”:假的,“disk_spec”: {},“cluster_source”:“API”,“enable_local_disk_encryption”:假的," gcp_attributes ": {“use_preemptible_executors”:假的}," instance_source ": {:“node_type_id n1-standard-4”}," driver_instance_source ": {:“node_type_id n1-standard-4”},“狀態”:“終止”,:“state_message集群終止活動”,“start_time”: 1619478205710,“terminated_time”: 1619487451280,“last_state_loss_time”: 1619478205710,"自動定量":{“min_workers”: 2“max_workers”: 8},“creator_user_name”:“someone@example.com”," termination_reason ": {“代碼”:“不活躍”,“參數”:{“inactivity_duration_min”:“120”},“類型”:“成功”},“init_scripts_safe_mode”:假的},]}

可用的集群節點類型列表

顯示使用文檔,運行集群list-node-types——幫助

磚集群list-node-types
{“node_type”:({“node_type_id”:“n2d - highcpu - 224”,“memory_mb”: 229376年,“num_cores”: 224.0,“描述”:“n2d - highcpu - 224”,“instance_type_id”:“n2d - highcpu - 224”,“類別”:“計算優化”,“support_ebs_volumes”:沒錯,“support_cluster_tags”:沒錯,“num_gpus”: 0,“support_port_forwarding”:沒錯,“display_order”: 0,“is_io_cache_enabled”:假的},]}

列表創建集群的可用區域

請注意

這個命令不能使用磚在穀歌的雲。

顯示使用文檔,運行集群list-zones——幫助

磚集群list-zones

永久刪除一個集群

顯示使用文檔,運行集群permanent-delete——幫助

磚集群permanent-delete——cluster-id1234年567890 - batch123

如果成功,沒有顯示輸出。

調整一個集群

顯示使用文檔,運行集群調整——幫助

磚集群大小——cluster-id1234年567890 - batch123——num-workers10

如果成功,沒有顯示輸出。

重新啟動集群

顯示使用文檔,運行集群重新啟動——幫助

磚集群——cluster-id重啟1234年567890 - batch123

如果成功,沒有顯示輸出。

列表可以引發運行時版本

顯示使用文檔,運行集群spark-versions——幫助

磚集群spark-versions
{“版本”:({“關鍵”:“8.2.x-scala2.12”,“名稱”:“8.2(包括Apache火花3.1.1,Scala 2.12)”},]}

開始一個集群

顯示使用文檔,運行集群開始——幫助

磚集群——cluster-id開始1234年567890 - batch123

如果成功,沒有顯示輸出。