

AWS Data Pipeline 不再提供給新客戶。的現有客戶 AWS Data Pipeline 可以繼續正常使用服務。[進一步了解](https://aws.amazon.com/blogs/big-data/migrate-workloads-from-aws-data-pipeline/)

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# EmrConfiguration
<a name="dp-object-emrconfiguration"></a>

EmrConfiguration 物件是 EMR 4.0.0 版本或更新版本叢集所使用的組態。組態 (做為清單) 是一個傳遞給 RunJobFlow API 呼叫的參數。Amazon EMR 的組態 API 採用分類和屬性。 AWS Data Pipeline 會使用 EmrConfiguration 搭配對應的屬性物件，在管道執行中啟動的 EMR 叢集上設定[EmrCluster](dp-object-emrcluster.md)應用程式，例如 Hadoop、Hive、Spark 或 Pig。由於您只能為新叢集變更組態，因此您無法為現有的資源提供 EmrConfiguration 物件。如需詳細資訊，請參閱[https://docs.aws.amazon.com/ElasticMapReduce/latest/ReleaseGuide/](https://docs.aws.amazon.com/ElasticMapReduce/latest/ReleaseGuide/)。

## 範例
<a name="emrconfiguration-example"></a>

以下組態物件會設定 `core-site.xml` 中的 `io.file.buffer.size` 和 `fs.s3.block.size` 屬性：

```
[
   {  
      "classification":"core-site",
      "properties":
      {
         "io.file.buffer.size": "4096",
         "fs.s3.block.size": "67108864"
      }
   }
]
```

對應管道物件定義會使用 EmrConfiguration 物件，並在 `property` 欄位中使用 Property 物件的清單：

```
{
  "objects": [
    {
      "name": "ReleaseLabelCluster",
      "releaseLabel": "emr-4.1.0",
      "applications": ["spark", "hive", "pig"],
      "id": "ResourceId_I1mCc",
      "type": "EmrCluster",
      "configuration": {
        "ref": "coresite"
      }
    },
    {
      "name": "coresite",
      "id": "coresite",
      "type": "EmrConfiguration",
      "classification": "core-site",
      "property": [{
        "ref": "io-file-buffer-size"
      },
      {
        "ref": "fs-s3-block-size"
      }
      ]
    },
    {
      "name": "io-file-buffer-size",
      "id": "io-file-buffer-size",
      "type": "Property",
      "key": "io.file.buffer.size",
      "value": "4096"
    },
    {
      "name": "fs-s3-block-size",
      "id": "fs-s3-block-size",
      "type": "Property",
      "key": "fs.s3.block.size",
      "value": "67108864"
    }
  ]
}
```

以下範例是一個巢狀組態，使用 `hadoop-env` 分類設定 Hadoop 環境：

```
[
  {
    "classification": "hadoop-env",
    "properties": {},
    "configurations": [
      {
        "classification": "export",
        "properties": {
          "YARN_PROXYSERVER_HEAPSIZE": "2396"
        }
      }
    ]
  }
]
```

以下是使用此組態的對應管道定義物件：

```
{
  "objects": [
    {
      "name": "ReleaseLabelCluster",
      "releaseLabel": "emr-4.0.0",
      "applications": ["spark", "hive", "pig"],
      "id": "ResourceId_I1mCc",
      "type": "EmrCluster",
      "configuration": {
        "ref": "hadoop-env"
      }
    },
    {
      "name": "hadoop-env",
      "id": "hadoop-env",
      "type": "EmrConfiguration",
      "classification": "hadoop-env",
      "configuration": {
        "ref": "export"
      }
    },
    {
      "name": "export",
      "id": "export",
      "type": "EmrConfiguration",
      "classification": "export",
      "property": {
        "ref": "yarn-proxyserver-heapsize"
      }
    },
    {
      "name": "yarn-proxyserver-heapsize",
      "id": "yarn-proxyserver-heapsize",
      "type": "Property",
      "key": "YARN_PROXYSERVER_HEAPSIZE",
      "value": "2396"
    },
  ]
}
```

下列範例會修改 EMR 叢集的 Hive 特定屬性：

```
{
    "objects": [
        {
            "name": "hivesite",
            "id": "hivesite",
            "type": "EmrConfiguration",
            "classification": "hive-site",
            "property": [
                {
                    "ref": "hive-client-timeout"
                }
            ]
        },
        {
            "name": "hive-client-timeout",
            "id": "hive-client-timeout",
            "type": "Property",
            "key": "hive.metastore.client.socket.timeout",
            "value": "2400s"
        }
    ]
}
```

## 語法
<a name="emrconfiguration-syntax"></a>

此物件包含以下欄位。


****  

| 必要欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| 分類 | 組態的分類。 | String | 

 


****  

| 選用欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| 組態 | 此組態的子組態。 | 參考物件，例如 "configuration":\$1"ref":"myEmrConfigurationId"\$1 | 
| parent | 目前物件的父系，其插槽會被繼承。 | 參考物件，例如 "parent":\$1"ref":"myBaseObjectId"\$1 | 
| 屬性 | 組態屬性。 | 參考物件，例如 "property":\$1"ref":"myPropertyId"\$1 | 

 


****  

| 執行時間欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| @version | 建立物件使用的管道版本。 | String | 

 


****  

| 系統欄位 | Description | 槽類型 | 
| --- | --- | --- | 
| @error | 描述格式錯誤物件的錯誤 | String | 
| @pipelineId | 此物件所屬管道的 ID | String | 
| @sphere | 物件範圍代表其在生命週期中的位置：Component 物件會引發執行 Attempt 物件的 Instance 物件 | String | 

## 另請參閱
<a name="emrconfiguration-seealso"></a>
+ [EmrCluster](dp-object-emrcluster.md)
+ [屬性](dp-object-property.md)
+ [Amazon EMR 版本指南](https://docs.aws.amazon.com/ElasticMapReduce/latest/ReleaseGuide/)