2017-11-07 7 views
0

Ich verwende AmazonElasticMapReduceAsyncClientBuilder, um die Autoscaling-Richtlinie für eine Instanzgruppe festzulegen.Fehler beim Bereitstellen der AutoScaling-Richtlinie: EMR-Instanzgruppe existiert nicht

Ich erhalte den folgenden Fehler in meiner Autoscale-Richtlinie, wenn ich eine aws emr beschreiben-Cluster - Cluster-ID j-XXXXXXXXX. ich tun, um die Cluster haben, Instance Gruppe & IAM automatische Skalierung Rolle (EMR_AutoScaling_DefaultRole) verfügbar

"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" } 

meine putautoscale Anfrage ist

{ "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 } } 

Ergebnis aus zukünftigen Objekt

{ 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 
        } 
       ] 
       } 
      } 
      } 
     ] } } 

Zustandsänderungen aus schwebenden zu fehlgeschlagen java code

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

ich das Äquivalent von

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

Thankyou

Antwort

0

Für mich tun, war dies, weil Cluster nicht markiert wurde "visibleToAllUsers"; Ich musste zuerst eine Änderung vornehmen.

Verwandte Themen