簡體   English   中英

無法設置AutoScaling策略:EMR實例組不存在

[英]Failed to provision the AutoScaling policy: EMR instance group doesn't exist

我正在使用AmazonElasticMapReduceAsyncClientBuilder設置實例組的自動縮放策略。

當我執行aws emr describe-cluster --cluster-id j-XXXXXXXXX時,在自動縮放策略中遇到以下錯誤。 我確實有可用的群集,實例組和IAM自動縮放角色(EMR_AutoScaling_DefaultRole)

"Status": {   "State": "FAILED",   "StateChangeReason": {
    "Message": "Failed to provision the AutoScaling policy: EMR instance group doesn't exist: Failed to find Cluster j-3SGZHX7D2DM98.",
    "Code": "PROVISION_FAILURE"   }

我的putautoscale請求是

{   "clusterId": "j-3SGZHX7D2DM98",   "instanceGroupId": "ig-243GEE06N6JXS",   "autoScalingPolicy": {
    "constraints": {
      "minCapacity": 2,
      "maxCapacity": 10
    },
    "rules": [
      {
        "name": "Default-scale-out",
        "description": "Replicates the default scale-out rule in the console for YARN memory by adding one additional instance",
        "action": {
          "simpleScalingPolicyConfiguration": {
            "adjustmentType": "CHANGE_IN_CAPACITY",
            "scalingAdjustment": 1,
            "coolDown": 300
          }
        },
        "trigger": {
          "cloudWatchAlarmDefinition": {
            "comparisonOperator": "LESS_THAN",
            "evaluationPeriods": 1,
            "metricName": "YARNMemoryAvailablePercentage",
            "namespace": "AWS/ElasticMapReduce",
            "period": 200,
            "statistic": "AVERAGE",
            "threshold": 25.0,
            "unit": "PERCENT",
            "dimensions": [
              {
                "key": "JobFlowId",
                "value": "j-3SGZHX7D2DM98"
              }
            ]
          }
        }
      },
      {
        "name": "Default-scale-In",
        "description": "Replicates the default scale-out rule in the console for YARN memory by terminating  one  instance",
        "action": {
          "simpleScalingPolicyConfiguration": {
            "adjustmentType": "CHANGE_IN_CAPACITY",
            "scalingAdjustment": -2,
            "coolDown": 300
          }
        },
        "trigger": {
          "cloudWatchAlarmDefinition": {
            "comparisonOperator": "GREATER_THAN_OR_EQUAL",
            "evaluationPeriods": 1,
            "metricName": "YARNMemoryAvailablePercentage",
            "namespace": "AWS/ElasticMapReduce",
            "period": 300,
            "statistic": "AVERAGE",
            "threshold": 50.0,
            "unit": "PERCENT",
            "dimensions": [
              {
                "key": "JobFlowId",
                "value": "j-3SGZHX7D2DM98"
              }
            ]
          }
        }
      }
    ]   },   "progressListener": {
       },   "requestClientOptions": {
    "markers": {

    },
    "readLimit": 131073   } } 

未來對象的結果

{   ClusterId: j-3SGZHX7D2DM98,   InstanceGroupId: ig-243GEE06N6JXS,   AutoScalingPolicy: {
        Status: {
          State: PENDING,
          StateChangeReason: {
            Code: USER_REQUEST,
            Message: AutoScalingpolicymodifiedbyuserrequest
          }
        },
        Constraints: {
          MinCapacity: 2,
          MaxCapacity: 10
        },
        Rules: [
          {
            Name: Default-scale-out,
            Description: Replicatesthedefaultscale-outruleintheconsoleforYARNmemorybyaddingoneadditionalinstance,
            Action: {
              SimpleScalingPolicyConfiguration: {
                AdjustmentType: CHANGE_IN_CAPACITY,
                ScalingAdjustment: 1,
                CoolDown: 300
              }
            },
            Trigger: {
              CloudWatchAlarmDefinition: {
                ComparisonOperator: LESS_THAN,
                EvaluationPeriods: 1,
                MetricName: YARNMemoryAvailablePercentage,
                Namespace: AWS/ElasticMapReduce,
                Period: 200,
                Statistic: AVERAGE,
                Threshold: 25.0,
                Unit: PERCENT,
                Dimensions: [
                  {
                    Key: JobFlowId,
                    Value: j-3SGZHX7D2DM98
                  }
                ]
              }
            }
          },
          {
            Name: Default-scale-In,
            Description: Replicatesthedefaultscale-outruleintheconsoleforYARNmemorybyterminatingoneinstance,
            Action: {
              SimpleScalingPolicyConfiguration: {
                AdjustmentType: CHANGE_IN_CAPACITY,
                ScalingAdjustment: -2,
                CoolDown: 300
              }
            },
            Trigger: {
              CloudWatchAlarmDefinition: {
                ComparisonOperator: GREATER_THAN_OR_EQUAL,
                EvaluationPeriods: 1,
                MetricName: YARNMemoryAvailablePercentage,
                Namespace: AWS/ElasticMapReduce,
                Period: 300,
                Statistic: AVERAGE,
                Threshold: 50.0,
                Unit: PERCENT,
                Dimensions: [
                  {
                    Key: JobFlowId,
                    Value: j-3SGZHX7D2DM98
                  }
                ]
              }
            }
          }
        ]   } }

狀態從掛起更改為失敗的Java代碼

Future<PutAutoScalingPolicyResult> putAutoScalingPolicyResultFuture=emr.putAutoScalingPolicyAsync(scalingPolicyRequest);
PutAutoScalingPolicyResultputAutoScalingPolicyResult=emr.putAutoScalingPolicy(scalingPolicyRequest);

我正在做相當於

aws emr put-auto-scaling-policy --cluster-id j-1EKZ3TYEVF1S2 --instance-group-id ig-3PLUZBA6WLS07 --auto-scaling-policy file://your/path/to/autoscaleconfig.json 

謝謝

對我來說,這是因為群集未標記為“ visibleToAllUsers”。 我必須發出

aws emr modify-instance-attributes --cluster-id BLAH --visible-to-all-users

首先改變。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM