ARMS通过日志服务的Logtail Agent收集ECS日志。本文介绍如何在ECS实例上安装Logtail Agent。

安装Logtail

  1. 登录ARMS控制台
  2. 在控制台左侧导航栏中选择自定义监控数据源管理 > 云服务器ECS
  3. 实例列表页面,单击需要安装的ECS实例右侧的安装Agent选项。
  4. 根据机器所处的网络环境和日志服务所在地域下载安装器,选择不同参数完成安装。
说明 Agent安装为覆盖安装模式。如果之前已安装过Logtail,那么安装器会先执行卸载、删除/usr/local/ilogtail目录后再重新安装。安装后默认启动Logtail。

ECS经典网络

数据通过阿里云内网写入日志服务,不消耗公网带宽。适用于阿里云ECS。

  • 华北2(北京)
     wget http://logtail-release-cn-beijing.oss-cn-beijing-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh
      chmod 755 logtail.sh
      sudo ./logtail.sh install cn-beijing
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华北1(青岛)
     wget http://logtail-release-cn-qingdao.oss-cn-qingdao-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh
      chmod 755 logtail.sh
      sudo ./logtail.sh install cn-qingdao
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华东1(杭州)
     wget http://logtail-release-cn-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh
      chmod 755 logtail.sh
      sudo ./logtail.sh install cn-hangzhou
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华东2(上海)
     wget http://logtail-release-cn-shanghai.oss-cn-shanghai-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh
      chmod 755 logtail.sh
      sudo ./logtail.sh install cn-shanghai
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华南1(深圳)
     wget http://logtail-release-cn-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/linux64/logtail.sh -O logtail.sh
      chmod 755 logtail.sh
      sudo ./logtail.sh install cn-shenzhen
      sudo touch /etc/ilogtail/users/1098370038733503

ECS专有网络VPC

数据通过阿里云专有网络写入日志服务。适用于阿里云ECS VPC。

  • 华北2(北京)
     wget http://logtail-release-bj.vpc100-oss-cn-beijing.aliyuncs.com/linux64/logtail.sh
      chmod 755 logtail.sh
      sudo sh logtail.sh install cn_beijing_vpc
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华东1(杭州)
     wget http://logtail-release.vpc100-oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
      chmod 755 logtail.sh
      sudo sh logtail.sh install cn_hangzhou_vpc
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华东2(上海)
     wget http://logtail-release-sh.vpc100-oss-cn-shanghai.aliyuncs.com/linux64/logtail.sh
      chmod 755 logtail.sh
      sudo sh logtail.sh install cn_shanghai_vpc
      sudo touch /etc/ilogtail/users/1098370038733503
  • 华南1(深圳)
     wget http://logtail-release-sz.vpc100-oss-cn-shenzhen.aliyuncs.com/linux64/logtail.sh
      chmod 755 logtail.sh
      sudo sh logtail.sh install cn_shenzhen_vpc
      sudo touch /etc/ilogtail/users/1098370038733503

公网(自建IDC或其他云主机)

数据通过公网写入日志服务,占用公网带宽。适用于非阿里云虚拟机或其它IDC。

日志服务无法获取非阿里云机器的属主信息,请在安装Logtail后手动配置用户标识,否则会导致Logtail心跳异常,无法收集日志。

  • 华北2(北京)
    wget http://logtail-release.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
     chmod 755 logtail.sh
     sudo sh logtail.sh install cn_beijing_internet
     sudo touch /etc/ilogtail/users/1098370038733503
  • 华北1(青岛)
    wget http://logtail-release.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
     chmod 755 logtail.sh
     sudo sh logtail.sh install cn_qingdao_internet
     sudo touch /etc/ilogtail/users/1098370038733503
  • 华东1(杭州)
     wget http://logtail-release.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
     chmod 755 logtail.sh
     sudo sh logtail.sh install cn_hangzhou_internet
     sudo touch /etc/ilogtail/users/1098370038733503
  • 华东2(上海)
    wget http://logtail-release.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
     chmod 755 logtail.sh
     sudo sh logtail.sh install cn_shanghai_internet
     sudo touch /etc/ilogtail/users/1098370038733503
  • 华南1(深圳)
    wget http://logtail-release.oss-cn-hangzhou.aliyuncs.com/linux64/logtail.sh
     chmod 755 logtail.sh
     sudo sh logtail.sh install cn_shenzhen_internet
     sudo touch /etc/ilogtail/users/1098370038733503

验证Logtail

  1. 在ARMS控制台左侧导航栏中选择自定义监控数据源管理 > 云服务器ECS
  2. 实例列表页面,单击需要检查的ECS实例右侧的检查Agent。稍等片刻,当Agent状态变为已安装时则表示生效。

卸载Logtail

参考安装Logtail下载安装器logtail.sh,并在Shell环境下以管理员权限执行以下命令:

sudo sh logtail.sh uninstall
sudo rm -rf /etc/ilogtail/users/1098370038733503