集群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”}
改变一个集群的配置
显示使用文档,运行砖集群编辑——帮助
。
砖集群的编辑——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”:假的},…]}
永久删除一个集群
显示使用文档,运行砖集群permanent-delete——帮助
。
砖集群permanent-delete——cluster-id1234年567890 - batch123
如果成功,没有显示输出。