安装Agent(Linux)
操作场景
本章节主要介绍如何在ECS或BMS中手动安装Agent,为用户提供主机的系统级、主动式、细颗粒度的监控服务。
约束与限制
目前只支持Linux操作系统和Windows操作系统。支持的系统请参见Agent支持的系统有哪些?。
在北京一、上海二、上海一、广州区域,对于使用CentOS 7.2-8.2和Ubuntu 20.04、18.04、16.04版本镜像的服务器,可以在主机监控插件状态栏单击“未安装”来实现一键安装。
前提条件
- 确保操作步骤中的安装目录都有读写权限,并且安装成功后的Telescope进程不会被其他软件关闭。
- 已参考修改DNS与添加安全组(Linux)完成DNS与安全组配置。
操作步骤
- 使用root账号,登录ECS或BMS。
- 执行以下命令,安装Agent。
脚本支持x86和鲲鹏ARM架构的ECS。
华北-北京一:
cd /usr/local && curl -k -O https://obs.cn-north-1.myhuaweicloud.com/uniagent-cn-north-1/script/agent_install.sh && bash agent_install.sh
华北-北京四:
cd /usr/local && curl -k -O https://obs.cn-north-4.myhuaweicloud.com/uniagent-cn-north-4/script/agent_install.sh && bash agent_install.sh
华南-广州:
cd /usr/local && curl -k -O https://obs.cn-south-1.myhuaweicloud.com/uniagent-cn-south-1/script/agent_install.sh && bash agent_install.sh
华南-深圳:
cd /usr/local && curl -k -O https://obs.cn-south-2.myhuaweicloud.com/uniagent-cn-south-2/script/agent_install.sh && bash agent_install.sh
华东-上海一:
cd /usr/local && curl -k -O https://obs.cn-east-3.myhuaweicloud.com/uniagent-cn-east-3/script/agent_install.sh && bash agent_install.sh
华东-上海二:
cd /usr/local && curl -k -O https://obs.cn-east-2.myhuaweicloud.com/uniagent-cn-east-2/script/agent_install.sh && bash agent_install.sh
西南-贵阳一:
cd /usr/local && curl -k -O https://obs.cn-southwest-2.myhuaweicloud.com/uniagent-cn-southwest-2/script/agent_install.sh && bash agent_install.sh
中国-香港:
cd /usr/local && curl -k -O https://obs.ap-southeast-1.myhuaweicloud.com/uniagent-ap-southeast-1/script/agent_install.sh && bash agent_install.sh
亚太-曼谷:
cd /usr/local && curl -k -O https://obs.ap-southeast-2.myhuaweicloud.com/uniagent-ap-southeast-2/script/agent_install.sh && bash agent_install.sh
亚太-新加坡:
cd /usr/local && curl -k -O https://obs.ap-southeast-3.myhuaweicloud.com/uniagent-ap-southeast-3/script/agent_install.sh && bash agent_install.sh
非洲-约翰内斯堡:
cd /usr/local && curl -k -O https://obs.af-south-1.myhuaweicloud.com/uniagent-af-south-1/script/agent_install.sh && bash agent_install.sh
拉美-圣地亚哥:
cd /usr/local && wget https://telescope-la-south-2.obs.la-south-2.myhuaweicloud.com/scripts/agentInstall.sh && chmod 755 agentInstall.sh && ./agentInstall.sh
拉美-圣保罗一:
cd /usr/local && wget https://telescope-sa-brazil-1.obs.sa-brazil-1.myhuaweicloud.com/scripts/agentInstall.sh && chmod 755 agentInstall.sh && ./agentInstall.sh
当回显如图1所示时,说明Agent安装成功。 - 安装完成后,请参考修复插件配置(Linux)或手动配置Agent(Linux,可选)完成Agent的配置。
- 修复插件配置为用户提供了一键配置AK/SK、RegionID、ProjectId的功能,省去了繁琐的手动配置步骤,提升配置效率。也可以参考手动配置Agent(Linux,可选)自己修改相关配置文件。
- BMS不支持修复插件配置,请参考手动配置Agent(Linux,可选)修改相关配置文件。
- 执行如下命令,清除安装脚本。
if [[ -f /usr/local/uniagent/extension/install/telescope/bin/telescope ]]; then rm /usr/local/agent_install.sh; else rm /usr/local/agentInstall.sh; fi
