文档

启动、停止或卸载云助手客户端

更新时间:
重要

本文中含有需要您注意的重要提示信息,忽略该信息可能对您的业务造成影响,请务必仔细阅读。

云助手Agent是为ECS实例执行云助手命令的代理程序。本文介绍如何启动、停止或卸载云助手Agent

启动或停止云助手Agent(Windows实例)

完成以下操作,启动或停止Windows实例的云助手Agent

警告

Aliyun Assist Service云助手Agent服务的显示名称,停止Aliyun Assist Service相当于停止云助手Agent,这可能会导致ECS实例异常,并无法在ECS管理控制台停止运行中的ECS实例。建议您谨慎停止云助手Agent

  1. 远程连接Windows实例。

    具体操作,请参见通过密码认证登录Windows实例

  2. 单击开始菜单,选择Windows 管理工具 > 计算机管理

  3. 选择计算机管理(本地) > 服务和应用程序 > 服务

  4. 找到Aliyun Assist Service服务,单击停止此服务或者重启动此服务

    重启动此服务

卸载云助手Agent(Windows实例)

如果您打算不再使用云助手Agent,可以进行如下操作卸载云助手Agent

  1. 参考启动或停止云助手Agent(Windows实例)的操作步骤停止云助手Agent

  2. 删除C:\ProgramData\aliyun\assist目录。

启动或停止云助手Agent(Linux实例)

说明

您在停止云助手Agent前,需要先卸载云助手守护进程。具体操作,请参见卸载云助手守护进程(Linux实例)

完成以下操作,启动或停止Linux实例的云助手Agent

  1. 远程连接Linux实例。

    具体操作,请参见远程连接Linux实例

  2. 根据ECS实例的init系统选择以下命令启动或停止云助手Agent服务。

    • 采用新版本内核的Linux系统通常使用systemd初始化进程服务,操作如下所示。

      • 查询您的ECS实例是否使用systemd初始化进程服务,有返回信息则表示使用的是systemd。

        strings /sbin/init | grep "/lib/system"
      • 停止云助手Agent

        systemctl stop aliyun.service
      • 启动云助手Agent

        systemctl start aliyun.service
      • 重启云助手Agent

        systemctl restart aliyun.service
    • 对于Ubuntu14及更低版本的Linux系统,通常使用UpStart初始化进程服务,操作如下所示。

      • 查询您的ECS实例是否使用UpStart初始化进程服务,有返回信息则表示使用的是UpStart。

        strings /sbin/init | grep "upstart"
      • 停止云助手Agent

        /sbin/initctl stop aliyun-service
      • 启动云助手Agent

        /sbin/initctl start aliyun-service
      • 重启云助手Agent

        /sbin/initctl restart aliyun-service
    • 采用低版本内核的Linux系统通常使用sysvinit初始化进程服务,操作如下所示。

      • 查询您的ECS实例是否使用sysvinit初始化进程服务,有返回信息则表示使用的是sysvinit。

        strings /sbin/init | grep "sysvinit"
      • 停止云助手Agent

        /etc/init.d/aliyun-service stop
      • 启动云助手Agent

        /etc/init.d/aliyun-service start
      • 重启云助手Agent

        /etc/init.d/aliyun-service restart

卸载云助手守护进程(Linux实例)

说明

如果云效托管的服务器需要卸载Agent,请参见主机部署

云助手守护进程用于监控云助手Agent的资源消耗情况,上报云助手Agent的运行状态,以及当云助手Agent崩溃时重启客户端。您在卸载云助手Agent前,需要先卸载云助手守护进程。

说明

目前云助手守护进程仅支持Linux操作系统。

  1. 远程连接Linux实例。

    具体操作,请参见远程连接Linux实例

  2. 停止云助手守护进程。

    /usr/local/share/assist-daemon/assist_daemon --stop
    说明

    /usr/local/share/assist-daemon/assist_daemon为云助手守护进程的默认路径。

  3. 卸载云助手守护进程。

    /usr/local/share/assist-daemon/assist_daemon --delete
  4. 删除云助手守护进程目录。

    rm -rf /usr/local/share/assist-daemon

卸载云助手Agent(Linux实例)

如果您打算不再使用云助手Agent,可以进行如下操作卸载云助手Agent

  1. 远程连接Linux实例。

    具体操作,请参见远程连接Linux实例

  2. 卸载云助手守护进程。

  3. 停止云助手Agent

  4. 运行以下命令卸载云助手Agent

    • rpm包管理:

      sudo rpm -qa | grep aliyun_assist | xargs sudo rpm -e
    • deb包管理:

      1. 运行sudo dpkg -l命令,查询云助手deb包名称。

      2. 运行sudo dpkg -r 云助手deb包名称命令,卸载云助手deb包。

    • 运行rm -rf /usr/local/share/aliyun-assist命令,删除云助手Agent目录。