Skip to content

set_unhealthy_node_replacement

set_unhealthy_node_replacement(
    *,
    config_overrides: Optional[EMRClientConfig] = None,
    job_flow_ids: Optional[XmlStringList] = None,
    unhealthy_node_replacement: Optional[BooleanObject] = None,
) -> None

Specify whether to enable unhealthy node replacement, which lets Amazon EMR gracefully replace core nodes on a cluster if any nodes become unhealthy. For example, a node becomes unhealthy if disk usage is above 90%. If unhealthy node replacement is on and TerminationProtected are off, Amazon EMR immediately terminates the unhealthy core nodes. To use unhealthy node replacement and retain unhealthy core nodes, use to turn on termination protection. In such cases, Amazon EMR adds the unhealthy nodes to a denylist, reducing job interruptions and failures.

If unhealthy node replacement is on, Amazon EMR notifies YARN and other applications on the cluster to stop scheduling tasks with these nodes, moves the data, and then terminates the nodes.

For more information, see graceful node replacement in the Amazon EMR Management Guide.

Parameters:

  • job_flow_ids (Optional[XmlStringList], default: None ) –

    The list of strings that uniquely identify the clusters for which to turn on unhealthy node replacement. You can get these identifiers by running the RunJobFlow or the DescribeJobFlows operations.

  • unhealthy_node_replacement (Optional[BooleanObject], default: None ) –

    Indicates whether to turn on or turn off graceful unhealthy node replacement.

Raises:

  • InternalServerError –

    Indicates that an error occurred while processing the request and that the request was not completed.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_emr/_services/emr.py
def set_unhealthy_node_replacement(
    self,
    *,
    config_overrides: Optional[EMRClientConfig] = None,
    job_flow_ids: Optional["capo_emr.types.xml_string_list.XmlStringList"] = None,
    unhealthy_node_replacement: Optional[
        "capo_emr.types.boolean_object.BooleanObject"
    ] = None,
) -> None:
    """<p>Specify whether to enable unhealthy node replacement, which lets Amazon EMR gracefully replace core nodes on a cluster if any nodes become unhealthy. For example, a node becomes unhealthy if disk usage is above 90%. If unhealthy node replacement is on and <code>TerminationProtected</code> are off, Amazon EMR immediately terminates the unhealthy core nodes. To use unhealthy node replacement and retain unhealthy core nodes, use to turn on termination protection. In such cases, Amazon EMR adds the unhealthy nodes to a denylist, reducing job interruptions and failures.</p> <p>If unhealthy node replacement is on, Amazon EMR notifies YARN and other applications on the cluster to stop scheduling tasks with these nodes, moves the data, and then terminates the nodes.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-node-replacement.html">graceful node replacement</a> in the <i>Amazon EMR Management Guide</i>.</p>

    Args:
        job_flow_ids: <p>The list of strings that uniquely identify the clusters for which to turn on unhealthy node replacement. You can get these identifiers by running the <a>RunJobFlow</a> or the <a>DescribeJobFlows</a> operations.</p>
        unhealthy_node_replacement: <p>Indicates whether to turn on or turn off graceful unhealthy node replacement.</p>

    Raises:
        capo_emr.errors.internal_server_error.InternalServerError: <p>Indicates that an error occurred while processing the request and that the request was not completed.</p>
        capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr.types.set_unhealthy_node_replacement_input.SetUnhealthyNodeReplacementInput]",
    ) -> OperationResponse[None]:
        import capo_emr._operations.elastic_map_reduce.set_unhealthy_node_replacement

        output, http_response = (
            capo_emr._operations.elastic_map_reduce.set_unhealthy_node_replacement.set_unhealthy_node_replacement(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("SetUnhealthyNodeReplacement")
    )
    input_: capo_emr.types.set_unhealthy_node_replacement_input.SetUnhealthyNodeReplacementInput = {}
    if job_flow_ids is not None:
        input_["job_flow_ids"] = job_flow_ids
    if unhealthy_node_replacement is not None:
        input_["unhealthy_node_replacement"] = unhealthy_node_replacement

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output