aws cli如何根据cluster id 查找 emr job参数
时间: 2024-09-11 21:16:37 浏览: 82
AWS CLI (Amazon Web Services Command Line Interface) 是一个工具,它允许用户通过命令行界面管理 Amazon EMR (Elastic MapReduce) 集群和服务。如果你想要查找特定 EMR Job 的参数,特别是基于集群 ID,你可以按照以下步骤操作:
1. **登录 AWS CLI**:
先确保已经安装了 `aws configure` 并配置好你的AWS凭证。
2. **列出EMR Cluster信息**:
使用 `aws emr list-clusters` 命令获取所有集群的信息,包括ID。这将返回一个包含集群状态、名称和ID等详细信息的列表。
```shell
$ aws emr list-clusters --output json
```
3. **过滤出目标集群**:
知道集群ID后,可以用 `--cluster-id` 参数筛选出特定集群。
```shell
$ aws emr describe-cluster --cluster-id <CLUSTER_ID> --output json
```
4. **查找Job Flow Details**:
描述集群后,可以在响应中找到 JobFlow IDs,然后进一步查看 Job Detail。
```shell
$ aws emr describe-job-flows --job-flow-id <JOB_FLOW_ID> --output json
```
5. **提取Job参数**:
在 `describe-job-flows` 的结果中,查找 "Steps" 或 "Configurations" 节点,那里通常会包含作业的详细配置,包括参数。
6. **显示具体参数**:
如果你想看到某个参数的具体值,可以指定参数名来查看。例如,假设你想看名为 "myCustomParameter" 的参数:
```shell
$ aws emr get-step --step-id <STEP_ID> --cluster-id <CLUSTER_ID> --output json | jq '.ConfigurationSettings[] | select(.Classification == "spark") | .Properties["myCustomParameter"]'
```
请注意,你需要使用 `jq` 工具来解析JSON数据,如果没有安装,可以考虑先安装或使用其他JSON解析方式。
阅读全文
相关推荐
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![.zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)