使用 Run Command 来关闭 Kernel Live Patching - AWS Systems Manager

使用 Run Command 来关闭 Kernel Live Patching

要关闭 Kernel Live Patching,您可以在托管式节点上运行 yum 命令,也可以使用 Run Command 以及自定义 SSM 文档 AWS-ConfigureKernelLivePatching

注意

如果您不再需要使用内核实时修补,可以随时关闭它。在大多数情况下,不需要关闭该功能。

有关通过直接在托管式节点上运行 yum 命令来关闭 Kernel Live Patching 的信息,请参阅《Amazon EC2 用户指南》中的启用 Kernel Live Patching

注意

关闭 Kernel Live Patching 时,该进程会卸载 Kernel Live Patching 插件,然后重启托管式节点。

使用 Run Command 来关闭 Kernel Live Patching (控制台)
  1. 访问 https://console.aws.amazon.com/systems-manager/,打开 AWS Systems Manager 控制台。

  2. 在导航窗格中,选择 Run Command

  3. 选择 Run command(运行命令)

  4. 命令文档 列表中,请选择 SSM 文档 AWS-ConfigureKernelLivePatching

  5. Command parameters (命令参数) 部分中,为必需的参数指定值。

  6. 有关使用此页上的其余控件的信息,请参阅 从控制台运行命令

  7. 选择运行

关闭 Kernel Live Patching (AWS CLI)
  • 运行类似于下面的命令。

    Linux & macOS
    aws ssm send-command \ --document-name "AWS-ConfigureKernelLivePatching" \ --targets "Key=instanceIds,Values=instance-id" \ --parameters "EnableOrDisable=Disable"
    Windows Server
    aws ssm send-command ^ --document-name "AWS-ConfigureKernelLivePatching" ^ --targets "Key=instanceIds,Values=instance-id" ^ --parameters "EnableOrDisable=Disable"

    instance-id 替换为要关闭该功能的 Amazon Linux 2 托管式节点的 ID,例如 i-02573cafcfEXAMPLE。要在多个托管式节点上关闭该功能,您可以使用以下任一格式。

    • --targets "Key=instanceids,Values=instance-id1,instance-id2"

    • --targets "Key=tag:tag-key,Values=tag-value"

    有关可以在命令中使用的其他选项的信息,请参阅《AWS CLI Command Reference》中的 send-command