From f6e4e159db5690a075ac76b4bb041465cd6c94ec Mon Sep 17 00:00:00 2001 From: k4xxx Date: Thu, 24 Oct 2024 17:19:23 +0800 Subject: [PATCH 1/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E8=87=AA=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...13\345\212\250\351\203\250\347\275\262.md" | 68 ++++---- ...50\345\214\226\351\203\250\347\275\262.md" | 158 ++++++++++++++++-- 2 files changed, 181 insertions(+), 45 deletions(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" index 5a27fe210c..cc5508bd06 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" @@ -1,48 +1,51 @@ # 部署说明 ```markdown -1. toneagent 支持不同os、不同arch,该文档以Linux、x86_64为例 -2. 该文档以2.0.6版本为例,版本及对应的链接见文末 +该文档以2.0.8版本为例,版本及对应的链接见文末 ``` # 部署步骤 -## 1.下载 -```shell -wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.6-1.an8.x86_64.rpm -``` -## 2.安装 +## 1.安装 ToneAgent 服务 +注意: +1.需要保证机器能连通`anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com` + +2.需要保证机器`yum`或`dpkg`命令可用 ```shell -yum install -y toneagent-2.0.6-1.an8.x86_64.rpm +# linux:x86_64 +yum install -y https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.an8.x86_64.rpm + +# linux:arm64 +yum install -y https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.aarch64.rpm + +# debian:x86_64 +dpkg -i https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-amd64.deb + +# debian:arm64 +dpkg -i https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-arm64.deb ``` -## 3.配置 -**配置说明**: +## 2.配置 ToneAgent 服务 +**2.1 配置说明**: ```markdown 1. tsn: agent机器的唯一识别码。在toneagent平台添加机器后自动生成 -2. mode: agent获取执行任务的模式。acitve为主动模式;passive为被动模式。(注意:不管是哪种模式,都要跟toneagent平台的设置一致) +2. mode: agent获取执行任务的模式。acitve为主动模式;passive为被动模式。(注意:需要跟toneagent平台的设置一致) 3. proxy: toneagent平台的域名地址。社区平台地址为:https://tone-agent.openanolis.cn ``` -**配置方式**: -```markdown +**2.2 配置方式**: + toneagent支持3种配置方式: -1. 更改配置文件 -2. 使用toneagent命令 -3. 使用toneagent配置页 -``` -**配置教程** -方式一:直接更改配置文件 +a. 更改配置文件 ```shell vim /etc/toneagent/conf/toneagent.yaml ``` - -方式二:使用toneagent命令 +b. 使用toneagent命令 ```shell toneagent -set-tsn=xxx toneagent -set-mode=active toneagent -set-proxy=https://proxy1.cn ``` -方式三:使用配置页面 +c. 使用toneagent配置页 ```shell # 浏览器访问(server_ip 为 agent 部署机的ip地址): http://${server_ip}:8479 @@ -55,12 +58,12 @@ http://${server_ip}:8479 ![](../assets/config.png) -## 4.重启服务 +## 3.重启服务 ```shell systemctl restart toneagent ``` -## 5.检查状态及心跳 +## 4.检查状态及心跳 ```shell systemctl status toneagent ``` @@ -87,13 +90,12 @@ systemctl status toneagent **版本** ```markdown 查看当前版本:toneagent -v -查看可用版本:toneagent -l ``` **升级** ```markdown 升级到最新版本:toneagent -upgrade=latest 升级到稳定版本:toneagent -upgrade=stable -升级到指定版本:toneagent -upgrade=2.0.x +升级到指定版本:toneagent -upgrade=2.0.8 ``` **配置** ```markdown @@ -105,13 +107,13 @@ systemctl status toneagent # 版本列表 | 版本 | OS | Arch | Link | |-------|--------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------| -| 2.0.8 | Linux | x86_64 | [toneagent-2.0.8-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | -| 2.0.8 | Linux | aarch64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.aarch64.rpm) | -| 2.0.8 | Linux | riscv64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.riscv64.rpm) | -| 2.0.8 | Ubuntu | x86_64 | [toneagent-2.0.8-amd64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-amd64.deb) | -| 2.0.8 | Ubuntu | aarch64 | [toneagent-2.0.8-arm64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-arm64.deb) | -| 2.0.7 | Linux | x86_64 | [toneagent-2.0.7-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | -| 2.0.7 | Linux | aarch64 | [toneagent-2.0.7-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.aarch64.rpm) | +| 2.0.8 | Linux | x86_64 | [toneagent-2.0.8-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | +| 2.0.8 | Linux | aarch64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.aarch64.rpm) | +| 2.0.8 | Linux | riscv64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.riscv64.rpm) | +| 2.0.8 | Ubuntu | x86_64 | [toneagent-2.0.8-amd64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-amd64.deb) | +| 2.0.8 | Ubuntu | aarch64 | [toneagent-2.0.8-arm64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-arm64.deb) | +| 2.0.7 | Linux | x86_64 | [toneagent-2.0.7-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | +| 2.0.7 | Linux | aarch64 | [toneagent-2.0.7-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.aarch64.rpm) | | 2.0.7 | Ubuntu | x86_64 | [toneagent-2.0.7-amd64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-amd64.deb) | | 2.0.7 | Ubuntu | aarch64 | [toneagent-2.0.7-arm64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-arm64.deb) | | 2.0.6 | Linux | x86_64 | [toneagent-2.0.6-1.an8.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.6-1.an8.x86_64.rpm) | diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" index 03b6b92229..3188c9bc3e 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" @@ -1,17 +1,16 @@ -### 自动部署 +## 自动部署 +### Linux 机器自动部署 ToneAgent 在部署机上执行如下命令: ```shell wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/deploy/deploy_toneagent.sh && chmod +x deploy_toneagent.sh && ./deploy_toneagent.sh -``` - -### 脚本详情 +```
点击展开/折叠脚本 ```shell #!/bin/bash -os=$(uname -s) +os=Linux arch=$(uname -m) domain=https://tone-agent.openanolis.cn @@ -27,21 +26,25 @@ uninstall_old_version(){ color_echo() { local message=$1 - echo -e "\033[0;32m${message}\033[0m" + echo -e "安装选项:\033[0;32m${message}\033[0m" } get_version_link() { if [ "$version" = "latest" ]; then - is_new=1 - is_stable="" + is_new=1 + is_stable="" version="" elif [ "$version" = "stable" ]; then - is_new="" - is_stable=1 + is_new="" + is_stable=1 + version="" + elif [ "$version" = "" ]; then + is_new=1 + is_stable="" version="" else is_new="" - is_stable="" + is_stable="" version=$version fi @@ -93,7 +96,7 @@ modify_config(){ } ############################################################################# -color_echo "请输入要部署的版本(如:2.0.6 ; 默认为:latest):" +color_echo "请输入要部署的版本(如:2.0.8 ; 默认为:latest):" read version if [ -z "$version" ]; then version=latest @@ -125,3 +128,134 @@ modify_config toneagent -v ```
+ +### Debian/Ubuntu 机器自动部署 ToneAgent +在部署机上执行如下命令: +```shell +wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/deploy/deploy_toneagent_debian.sh && chmod +x deploy_toneagent_debian.sh && ./deploy_toneagent_debian.sh +``` +
+ 点击展开/折叠脚本 + +```shell +#!/bin/bash + +os=Debian +arch=$(uname -m) +domain=https://tone-agent.openanolis.cn +config_file=/etc/toneagent/conf/toneagent.yaml + +install_utils() { + apt update -y >/dev/null + apt install -y jq curl wget >/dev/null +} + +uninstall_old_version() { + dpkg --purge toneagent +} + +color_echo() { + local message=\$1 + echo -e "\033[0;32m${message}\033[0m" +} + +get_version_link() { + if [ "$version" = "latest" ]; then + is_new=1 + is_stable="" + version="" + elif [ "$version" = "stable" ]; then + is_new="" + is_stable=1 + version="" + else + is_new="" + is_stable="" + version=$version + fi + # 调用API获取需要安装的版本 + api_url="$domain/v1/agent/version/manage?is_deleted=0&os=$os&arch=$arch&is_new=$is_new&is_stable=$is_stable&version=$version" + api_response=$(curl -s "$api_url") + + if ! echo "$api_response" | jq -e . >/dev/null 2>&1; then + echo "获取版本失败:$api_response" + exit + fi + + array_length=$(echo "$api_response" | jq '.data | length') + # 判断数组长度是否为0 + if [ "$array_length" -eq 0 ]; then + echo "无可用版本,请检查指定版本是否正确" + exit + fi + + # 解析API响应,获取版本链接 + version_link=$(echo "$api_response" | jq -r '.data[0].link') + version=$(basename "$version_link") + + if [ $? -eq 0 ]; then + echo "The $version version is $version" + else + echo "Upgrade failed" + exit + fi + + echo -e "\e[1;install toneagent(version:$version)\e[0m" +} + +install_agent() { + wget "$version_link" + dpkg -i ./"$version" + + if [ $? -eq 0 ]; then + echo "install toneagent success" + else + echo "install toneagent failed" + fi +} + +modify_config() { + echo -e "tsn: $tsn\nmode: $mode\nproxy: $proxy" > "$config_file" + + if [ $? -ne 0 ]; then + echo "[log]modify toneagent configuration failed..." + exit 1 + fi + + systemctl restart toneagent +} + +############################################################################# + +color_echo "请输入要部署的版本(如:2.0.8 ; 默认为:latest):" +read version +if [ -z "$version" ]; then + version=latest +fi + +color_echo "请输入机器的TSN(在ToneAgent平台添加机器后获取; 如需安装之后再修改直接回车):" +read tsn +if [ -z "$tsn" ]; then + tsn="" +fi + +color_echo "请输入Agent Mode(默认为:active):" +read mode +if [ -z "$mode" ]; then + mode=active +fi + +color_echo "请输入ToneAgent Proxy地址(默认为:https://tone-agent.openanolis.cn):" +read proxy +if [ -z "$proxy" ]; then + proxy=https://tone-agent.openanolis.cn +fi + +uninstall_old_version +install_utils +get_version_link +install_agent +modify_config +toneagent -v +``` +
-- Gitee From 0cc0d2fcb73ed9d0aad67aedccf03ef192e7d712 Mon Sep 17 00:00:00 2001 From: k4xxx Date: Thu, 24 Oct 2024 17:31:31 +0800 Subject: [PATCH 2/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E6=89=8B=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...13\345\212\250\351\203\250\347\275\262.md" | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" index cc5508bd06..90149d393d 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" @@ -10,18 +10,24 @@ 1.需要保证机器能连通`anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com` 2.需要保证机器`yum`或`dpkg`命令可用 + +3.如果该机器之前安装过 toneagent ,需要先执行`rpm -e toneagent`卸载旧版本 ```shell # linux:x86_64 -yum install -y https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.an8.x86_64.rpm +wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.x86_64.rpm +yum install -y toneagent-2.0.8-1.x86_64.rpm # linux:arm64 -yum install -y https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.aarch64.rpm +wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.aarch64.rpm +yum install -y toneagent-2.0.8-1.aarch64.rpm # debian:x86_64 -dpkg -i https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-amd64.deb +wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-amd64.deb +dpkg -i toneagent-2.0.8-amd64.deb # debian:arm64 -dpkg -i https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-arm64.deb +wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-arm64.deb +dpkg -i toneagent-2.0.8-arm64.deb ``` ## 2.配置 ToneAgent 服务 @@ -33,7 +39,7 @@ dpkg -i https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/ ``` **2.2 配置方式**: -toneagent支持3种配置方式: +toneagent支持2种配置方式: a. 更改配置文件 ```shell @@ -47,7 +53,9 @@ toneagent -set-proxy=https://proxy1.cn ``` c. 使用toneagent配置页 ```shell -# 浏览器访问(server_ip 为 agent 部署机的ip地址): +# 注意: +# 1. 浏览器访问(server_ip 为 agent 部署机的ip地址) +# 2. 需要保证8479端口可访问 http://${server_ip}:8479 ``` **登录(密码可在`/etc/toneagent/conf/app.yaml`里配置)** -- Gitee From 8a22ad6c782cca81502798051057098049ed7e66 Mon Sep 17 00:00:00 2001 From: k4xxx Date: Thu, 24 Oct 2024 17:34:29 +0800 Subject: [PATCH 3/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E6=89=8B=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...oneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" index 90149d393d..a50eae6a12 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" @@ -39,7 +39,7 @@ dpkg -i toneagent-2.0.8-arm64.deb ``` **2.2 配置方式**: -toneagent支持2种配置方式: +toneagent支持3种配置方式: a. 更改配置文件 ```shell -- Gitee From 9a129a9f094c26d1b0ad23ba6205692df5a0baea Mon Sep 17 00:00:00 2001 From: k4xxx Date: Mon, 28 Oct 2024 10:07:42 +0800 Subject: [PATCH 4/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E6=89=8B=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" | 1 - 1 file changed, 1 deletion(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" index a50eae6a12..23473e9545 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" @@ -117,7 +117,6 @@ systemctl status toneagent |-------|--------|---------|----------------------------------------------------------------------------------------------------------------------------------------------------------| | 2.0.8 | Linux | x86_64 | [toneagent-2.0.8-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | | 2.0.8 | Linux | aarch64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-1.aarch64.rpm) | -| 2.0.8 | Linux | riscv64 | [toneagent-2.0.8-1.aarch64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.riscv64.rpm) | | 2.0.8 | Ubuntu | x86_64 | [toneagent-2.0.8-amd64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-amd64.deb) | | 2.0.8 | Ubuntu | aarch64 | [toneagent-2.0.8-arm64.deb](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.8-arm64.deb) | | 2.0.7 | Linux | x86_64 | [toneagent-2.0.7-1.x86_64.rpm](https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/rpms/toneagent-2.0.7-1.x86_64.rpm) | -- Gitee From 94b24d8eb3b14459e4d5ff8e4484513ad1c3d157 Mon Sep 17 00:00:00 2001 From: k4xxx Date: Mon, 28 Oct 2024 16:26:00 +0800 Subject: [PATCH 5/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E6=89=8B=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Agent\346\211\213\345\212\250\351\203\250\347\275\262.md" | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" index 23473e9545..af3c2ff976 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\346\211\213\345\212\250\351\203\250\347\275\262.md" @@ -54,8 +54,9 @@ toneagent -set-proxy=https://proxy1.cn c. 使用toneagent配置页 ```shell # 注意: -# 1. 浏览器访问(server_ip 为 agent 部署机的ip地址) -# 2. 需要保证8479端口可访问 +# 1. 用浏览器访问 +# 2. ${server_ip} 是当前机器的公网 ip +# 3. 需要保证8479端口可访问 http://${server_ip}:8479 ``` **登录(密码可在`/etc/toneagent/conf/app.yaml`里配置)** -- Gitee From 5cec812bcf0b0606197a0379d210eeb9bddd361b Mon Sep 17 00:00:00 2001 From: k4xxx Date: Mon, 28 Oct 2024 17:17:15 +0800 Subject: [PATCH 6/6] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=20toneagent?= =?UTF-8?q?=20=E8=87=AA=E5=8A=A8=E9=83=A8=E7=BD=B2=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...50\345\214\226\351\203\250\347\275\262.md" | 251 +----------------- 1 file changed, 1 insertion(+), 250 deletions(-) diff --git "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" index 3188c9bc3e..83b8ad654e 100644 --- "a/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" +++ "b/sig/T-One/content/\347\224\250\346\210\267\346\214\207\345\215\227/\351\203\250\347\275\262\346\211\213\345\206\214/ToneAgent\350\207\252\345\212\250\345\214\226\351\203\250\347\275\262.md" @@ -4,258 +4,9 @@ ```shell wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/deploy/deploy_toneagent.sh && chmod +x deploy_toneagent.sh && ./deploy_toneagent.sh ``` -
- 点击展开/折叠脚本 - -```shell -#!/bin/bash - -os=Linux -arch=$(uname -m) - -domain=https://tone-agent.openanolis.cn -config_file=/etc/toneagent/conf/toneagent.yaml - -install_utils() { - yum install -y jq >/dev/null -} - -uninstall_old_version(){ - rpm -e toneagent --noscripts -} - -color_echo() { - local message=$1 - echo -e "安装选项:\033[0;32m${message}\033[0m" -} - -get_version_link() { - if [ "$version" = "latest" ]; then - is_new=1 - is_stable="" - version="" - elif [ "$version" = "stable" ]; then - is_new="" - is_stable=1 - version="" - elif [ "$version" = "" ]; then - is_new=1 - is_stable="" - version="" - else - is_new="" - is_stable="" - version=$version - fi - - # 调用API获取需要安装的版本 - api_url="$domain/v1/agent/version/manage?is_deleted=0&os=$os&arch=$arch&is_new=$is_new&is_stable=$is_stable&version=$version" - api_response=$(curl -s "$api_url") - if ! echo "$api_response" | jq -e . >/dev/null 2>&1; then - echo "获取版本失败:$api_response" - exit - fi - - array_length=$(echo "$api_response" | jq '.data | length') - # 判断数组长度是否为0 - if [ "$array_length" -eq 0 ]; then - echo "无可用版本,请检查指定版本是否正确" - exit - fi - - # 解析API响应,获取版本链接 - version_link=$(echo "$api_response" | jq -r '.data[0].link') - version=$(basename "$version_link") - - if [ $? -eq 0 ]; then - echo "The $version version is $version" - else - echo "Upgrade failed" - exit - fi - echo -e "\e[1;install toneagent(version:$version)\e[0m" -} - -install_agent() { - wget $version_link - yum install -y ./$version - if [ $? -eq 0 ]; then - echo "install toneagent success" - else - echo "install toneagent failed" - fi -} - -modify_config(){ - echo -e "tsn: $tsn\nmode: $mode\nproxy: $proxy" > $config_file - if [ $? -ne 0 ]; then - echo "[log]modify toneagent configuration failed..." - exit 1 - fi - systemctl restart toneagent -} - -############################################################################# -color_echo "请输入要部署的版本(如:2.0.8 ; 默认为:latest):" -read version -if [ -z "$version" ]; then - version=latest -fi - -color_echo "请输入机器的TSN(在ToneAgent平台添加机器后获取; 如需安装之后再修改直接回车):" -read tsn -if [ -z "$tsn" ]; then - tsn= -fi - -color_echo "请输入Agent Mode(默认为:active):" -read mode -if [ -z "$mode" ]; then - mode=active -fi - -color_echo "请输入ToneAgent Proxy地址(默认为:https://tone-agent.openanolis.cn):" -read proxy -if [ -z "$proxy" ]; then - proxy=https://tone-agent.openanolis.cn -fi - -uninstall_old_version -install_utils -get_version_link -install_agent -modify_config -toneagent -v -``` -
### Debian/Ubuntu 机器自动部署 ToneAgent 在部署机上执行如下命令: ```shell wget https://anolis-service-pub.oss-cn-zhangjiakou.aliyuncs.com/biz-resource/tone/deploy/deploy_toneagent_debian.sh && chmod +x deploy_toneagent_debian.sh && ./deploy_toneagent_debian.sh -``` -
- 点击展开/折叠脚本 - -```shell -#!/bin/bash - -os=Debian -arch=$(uname -m) -domain=https://tone-agent.openanolis.cn -config_file=/etc/toneagent/conf/toneagent.yaml - -install_utils() { - apt update -y >/dev/null - apt install -y jq curl wget >/dev/null -} - -uninstall_old_version() { - dpkg --purge toneagent -} - -color_echo() { - local message=\$1 - echo -e "\033[0;32m${message}\033[0m" -} - -get_version_link() { - if [ "$version" = "latest" ]; then - is_new=1 - is_stable="" - version="" - elif [ "$version" = "stable" ]; then - is_new="" - is_stable=1 - version="" - else - is_new="" - is_stable="" - version=$version - fi - # 调用API获取需要安装的版本 - api_url="$domain/v1/agent/version/manage?is_deleted=0&os=$os&arch=$arch&is_new=$is_new&is_stable=$is_stable&version=$version" - api_response=$(curl -s "$api_url") - - if ! echo "$api_response" | jq -e . >/dev/null 2>&1; then - echo "获取版本失败:$api_response" - exit - fi - - array_length=$(echo "$api_response" | jq '.data | length') - # 判断数组长度是否为0 - if [ "$array_length" -eq 0 ]; then - echo "无可用版本,请检查指定版本是否正确" - exit - fi - - # 解析API响应,获取版本链接 - version_link=$(echo "$api_response" | jq -r '.data[0].link') - version=$(basename "$version_link") - - if [ $? -eq 0 ]; then - echo "The $version version is $version" - else - echo "Upgrade failed" - exit - fi - - echo -e "\e[1;install toneagent(version:$version)\e[0m" -} - -install_agent() { - wget "$version_link" - dpkg -i ./"$version" - - if [ $? -eq 0 ]; then - echo "install toneagent success" - else - echo "install toneagent failed" - fi -} - -modify_config() { - echo -e "tsn: $tsn\nmode: $mode\nproxy: $proxy" > "$config_file" - - if [ $? -ne 0 ]; then - echo "[log]modify toneagent configuration failed..." - exit 1 - fi - - systemctl restart toneagent -} - -############################################################################# - -color_echo "请输入要部署的版本(如:2.0.8 ; 默认为:latest):" -read version -if [ -z "$version" ]; then - version=latest -fi - -color_echo "请输入机器的TSN(在ToneAgent平台添加机器后获取; 如需安装之后再修改直接回车):" -read tsn -if [ -z "$tsn" ]; then - tsn="" -fi - -color_echo "请输入Agent Mode(默认为:active):" -read mode -if [ -z "$mode" ]; then - mode=active -fi - -color_echo "请输入ToneAgent Proxy地址(默认为:https://tone-agent.openanolis.cn):" -read proxy -if [ -z "$proxy" ]; then - proxy=https://tone-agent.openanolis.cn -fi - -uninstall_old_version -install_utils -get_version_link -install_agent -modify_config -toneagent -v -``` -
+``` \ No newline at end of file -- Gitee