From 2c21809e8b10271486b5b8730d84f907e3987933 Mon Sep 17 00:00:00 2001 From: Ww67652 <1749113286@qq.com> Date: Sun, 29 Sep 2024 15:28:13 +0800 Subject: [PATCH 1/8] update: add deployment for v2 protocol (ConfigServer) --- config_server/deployment/.env | 6 ++ config_server/deployment/Dockerfile-Agent | 18 +++++ config_server/deployment/README.md | 41 +++++++++++ .../deployment/docker-compose-dev.yml | 65 +++++++++++++++++ config_server/deployment/docker-compose.yml | 69 +++++++++++++++++++ .../deployment/ilogtail_config.template.json | 8 +++ 6 files changed, 207 insertions(+) create mode 100644 config_server/deployment/.env create mode 100755 config_server/deployment/Dockerfile-Agent create mode 100644 config_server/deployment/README.md create mode 100644 config_server/deployment/docker-compose-dev.yml create mode 100644 config_server/deployment/docker-compose.yml create mode 100644 config_server/deployment/ilogtail_config.template.json diff --git a/config_server/deployment/.env b/config_server/deployment/.env new file mode 100644 index 0000000000..6b501c5b35 --- /dev/null +++ b/config_server/deployment/.env @@ -0,0 +1,6 @@ +CONFIG_SERVER=../service +CONFIG_SERVER_UI=../ui + +# 需把该目录下的Dockerfile-agent复制到agent对应的目录下,并修改${AGENT}为agent所在目录路径 +AGENT=/home/ilogtail-2.0.7 +AGENT_DEV_DOCKERFILE=/home/nzh/ilogtail/config_server/deployment/Dockerfile-Agent \ No newline at end of file diff --git a/config_server/deployment/Dockerfile-Agent b/config_server/deployment/Dockerfile-Agent new file mode 100755 index 0000000000..b04424d8f8 --- /dev/null +++ b/config_server/deployment/Dockerfile-Agent @@ -0,0 +1,18 @@ +FROM centos:7 + +RUN curl -L -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo \ + && yum update -y \ + && yum upgrade -y \ + && yum -y clean all \ + && rm -fr /var/cache \ + && rm -rf /core.* \ + && yum install -y gettext + +WORKDIR /agent +COPY . . + +CMD envsubst < ilogtail_config.template.json > ilogtail_config.json \ + && sh -c ./ilogtail > stdout.log 2> stderr.log + + + diff --git a/config_server/deployment/README.md b/config_server/deployment/README.md new file mode 100644 index 0000000000..7815f86214 --- /dev/null +++ b/config_server/deployment/README.md @@ -0,0 +1,41 @@ +# 部署说明 + +本项目实现了config-server的后端(config-server)与前端(config-server-ui),并基于docker与docker-compose的方式进行部署 + +## 快速开始 + +进入`deployment`目录,运行`deployment-compose.yml`,启动三个容器(`mysql`、`config-server`、`config-server-ui`) + +```shell +docker compose -f docker-compose.yml up -d +``` + +启动成功后,通过`http://{your-ip}:8080`即可实现前端页面的访问 + +![config-server-ui](../ui/public/config-server-ui.png) + +## Agent启动 + +为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, +修改`.env`中的`${AGENT}`为Agent所在目录路径(Agent安装与启动见[quick-start](https://github.com/alibaba/ilogtail/blob/main/docs/cn/installation/quick-start.md)),并在`docker-compose.yml`添加 +```yml + agent: + build: + context: ${AGENT} + dockerfile: Dockerfile-Agent + image: ilogtail:nzh + environment: + CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' + TZ: Asia/Shanghai + deploy: + replicas: 3 + networks: + - server +``` + +再次运行下面的命令,这将会启动3个ilogtail Agent。 + +```shell +docker compose -f docker-compose.yml up -d +``` + diff --git a/config_server/deployment/docker-compose-dev.yml b/config_server/deployment/docker-compose-dev.yml new file mode 100644 index 0000000000..3b1f84db4f --- /dev/null +++ b/config_server/deployment/docker-compose-dev.yml @@ -0,0 +1,65 @@ +version: '3.8' +services: + mysql: + image: mysql:latest + volumes: + - /var/lib/mysql:/var/lib/mysql + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: "123456" + cap_add: + - SYS_NICE + networks: + - server + + config-server-dev: + build: + context: ${CONFIG_SERVER} + #Dockerfile指定了context后,若不使用全局路径,则为context的相对路径 + dockerfile: Dockerfile-dev + image: config-server-dev:nzh + #替换成你代码的位置 + volumes: + - ${CONFIG_SERVER}:/backend + ports: + - "9090:9090" + environment: + TZ: Asia/Shanghai + networks: + - server + depends_on: + - mysql + + agent-dev: + build: + #确保目录下有agent + context: ${AGENT} + dockerfile: ${AGENT_DEV_DOCKERFILE} + image: ilogtail-dev:nzh + environment: + CONFIG_SERVER_ADDRESSES: '["host.docker.internal:9090"]' + TZ: Asia/Shanghai + extra_hosts: + - "host.docker.internal:host-gateway" + deploy: + replicas: 2 + networks: + - server + + config-server-ui: + build: + context: ${CONFIG_SERVER_UI} + dockerfile: Dockerfile + image: config-server-ui:nzh + ports: + - "8080:8080" + environment: + TZ: Asia/Shanghai + extra_hosts: + - "host.docker.internal:host-gateway" + networks: + - server + +networks: + server: diff --git a/config_server/deployment/docker-compose.yml b/config_server/deployment/docker-compose.yml new file mode 100644 index 0000000000..5a0b1323aa --- /dev/null +++ b/config_server/deployment/docker-compose.yml @@ -0,0 +1,69 @@ +version: '3.8' +services: + mysql: + image: mysql:latest + volumes: + - /var/lib/mysql:/var/lib/mysql + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: "123456" + cap_add: + - SYS_NICE + healthcheck: + test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ] + interval: 10s + retries: 5 + timeout: 5s + networks: + - server + + config-server: + build: + context: ${CONFIG_SERVER} + dockerfile: Dockerfile + # 如果之前构建过镜像,再次docker compose则不会重新构建 + image: config-server:nzh + ports: + - "9090:9090" + environment: + TZ: Asia/Shanghai + extra_hosts: + - "host.docker.internal:host-gateway" + networks: + - server + depends_on: + mysql: + condition: service_healthy + + config-server-ui: + build: + context: ${CONFIG_SERVER_UI} + dockerfile: Dockerfile + image: config-server-ui:nzh + ports: + - "8080:8080" + environment: + TZ: Asia/Shanghai + extra_hosts: + - "host.docker.internal:host-gateway" + networks: + - server + +# 通过下面的服务启动ilogtail agent的docker版本,并与config-server成功通信,具体配置流程见readme + agent: + build: + context: ${AGENT} + dockerfile: Dockerfile-Agent + image: ilogtail:nzh + environment: + CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' + TZ: Asia/Shanghai + deploy: + replicas: 3 + networks: + - server + +#替换成你自己的网络 +networks: + server: diff --git a/config_server/deployment/ilogtail_config.template.json b/config_server/deployment/ilogtail_config.template.json new file mode 100644 index 0000000000..eaf828bb58 --- /dev/null +++ b/config_server/deployment/ilogtail_config.template.json @@ -0,0 +1,8 @@ +{ + "config_server_list" : [ + { + "cluster":"community", + "endpoint_list":$CONFIG_SERVER_ADDRESSES + } + ] +} \ No newline at end of file From 9772c4740a272b83b36705b24bda0f6409acf347 Mon Sep 17 00:00:00 2001 From: Ww67652 <1749113286@qq.com> Date: Sun, 29 Sep 2024 20:26:08 +0800 Subject: [PATCH 2/8] update: add docs for config-server v2 --- docs/cn/config-server/deployment.md | 38 ++++++++++ docs/cn/config-server/quick-start.md | 102 +++++---------------------- docs/cn/config-server/service.md | 76 ++++++++++++++++++++ docs/cn/config-server/ui.md | 14 ++++ 4 files changed, 144 insertions(+), 86 deletions(-) create mode 100644 docs/cn/config-server/deployment.md create mode 100644 docs/cn/config-server/service.md create mode 100644 docs/cn/config-server/ui.md diff --git a/docs/cn/config-server/deployment.md b/docs/cn/config-server/deployment.md new file mode 100644 index 0000000000..e7e93e591a --- /dev/null +++ b/docs/cn/config-server/deployment.md @@ -0,0 +1,38 @@ +# 部署说明 + +本项目实现了config-server的后端(config-server)与前端(config-server-ui),并基于docker与docker-compose的方式进行部署 + +## 快速开始 + +下载ilogtail源码,进入`config_server/deployment`目录,运行`deployment-compose.yml`,启动三个容器(`mysql`、`config-server`、`config-server-ui`) + +```shell +docker compose -f docker-compose.yml up -d +``` + +启动成功后,通过`http://{your-ip}:8080`即可实现前端页面的访问 + +## Agent启动 + +为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, +修改`.env`中的`${AGENT}`为Agent所在目录路径(Agent安装与启动见[quick-start](https://github.com/alibaba/ilogtail/blob/main/docs/cn/installation/quick-start.md)),并在`docker-compose.yml`添加 +```yml + agent: + build: + context: ${AGENT} + dockerfile: Dockerfile-Agent + image: ilogtail:nzh + environment: + CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' + TZ: Asia/Shanghai + deploy: + replicas: 3 + networks: + - server +``` + +再次运行下面的命令,这将会启动3个ilogtail Agent。 + +```shell +docker compose -f docker-compose.yml up -d +``` \ No newline at end of file diff --git a/docs/cn/config-server/quick-start.md b/docs/cn/config-server/quick-start.md index 4e61f00f2c..c217842def 100644 --- a/docs/cn/config-server/quick-start.md +++ b/docs/cn/config-server/quick-start.md @@ -1,6 +1,6 @@ # 使用介绍 -## 简介 +## 一、简介 目前可观测采集 Agent,例如 iLogtail,主要提供了本地采集配置管理模式,当涉及实例数较多时,需要逐个实例进行配置变更,管理比较复杂。此外,多实例场景下 Agent 的版本信息、运行状态等也缺乏统一的监控。因此,需要提供全局管控服务用于对可观测采集 Agent 的采集配置、版本信息、运行状态等进行统一的管理。 @@ -10,19 +10,21 @@ ConfigServer 就是这样的一款可观测 Agent 管控工具,目前支持: * 以 Agent 组的形式对采集 Agent 进行统一管理 * 远程批量配置采集 Agent 的采集配置 * 监控采集 Agent 的运行状态 +* 监控采集Agent的配置运行状态 -## 术语表 +## 二、术语表 * 采集 Agent:数据采集器。可以是 iLogtail,或者其他的采集器。 -* 采集配置:一个数据采集 Pipeline,对应一组独立的数据采集配置。 -* AgentGroup:可以将相同属性的Agent划分为一个组,只需要绑定采集配置到 AgentGroup 即可在组内所有 Agent 生效。目前仅支持单 AgentGroup(即默认的 AgentGroup `default`)。 +* 采集配置:一个数据采集 Pipeline或Instance,对应一组独立的数据采集配置 +* AgentGroup:可以将相同属性的Agent划分为一个组,只需要绑定采集配置到 AgentGroup 即可在组内所有 Agent 生效。 * ConfigServer:采集配置管控的服务端。 +* ConfigServer UI:采集配置管控的控制台页面 -## 功能描述 +## 三、功能描述 对采集 Agent 进行全局管控。任何服从协议的Agent,都可以受到统一的管控。 -### 实例注册 +### 3.1 实例注册 * Agent 侧配置已部署的 ConfigServer 信息。 * Agent 启动后,定期向 ConfigServer 进行心跳注册,证明存活性。 @@ -32,102 +34,30 @@ ConfigServer 就是这样的一款可观测 Agent 管控工具,目前支持: * 启动时间 * 运行状态 -### AgentGroup 管理 +### 3.2 AgentGroup 管理 * Agent 管理的基本单元是 AgentGroup ,采集配置通过关联 AgentGroup 生效到组内的 Agent 实例上。 * 系统默认创建 default 组,所有 Agent 也会默认加到 default 组。 * 支持通过 AgentGroup 的 Tag 实现自定义分组。如果 Agent 的 Tag 与 AgentGroup 的 Tag 匹配,则加入该组。 * 一个 AgentGroup 可以包含多个 Agent,一个 Agent 可以属于多个组。 -### 采集配置全局管控 +### 3.3 采集配置全局管控 * 采集配置通过API进行服务端配置,之后与 AgentGroup 绑定后,即可生效到组内 Agent 实例上。 * 通过采集配置版本号区分采集配置差异,增量变更到 Agent 侧。 -### 状态监控 +### 3.4 状态监控 * Agent 定期向 ConfigServer 发送心跳,上报运行信息。 * ConfigServer 汇集后统一通过API对外呈现。 -## 运行 +## 四、运行 -ConfigServer 分为 UI 和 Service 两部分,可以分别独立运行。 +ConfigServer 分为 UI 和 Service 两部分,可以分别独立运行,下载ilogtail源码,进入`config_server`目录。 -### Agent 配置 +- 后端使用GO基于gin框架开发,针对https://github.com/alibaba/ilogtail/tree/main/config_server/protocol/v2 中提到的Agent行为进行了V2版本的适配,基本实现了能力报告、心跳压缩、配置状态上报等功能,并包含用户端接口,启动见[service](service.md)。 +- 前端使用 Vue + Element plus 组件库 + Vue cli 脚手架工具进行开发,旨在为用户提供一个简单、实用、易嵌入的 Config Server 前端控制台,启动见[ui](ui.md)。 +- 本项目提供了docker compose一键部署脚本,帮助用户快速搭建可用可视化与agent连通的config-server应用,详情见[deployment](deployment.md)。 -Agent 侧需要配置 ConfigServer 信息,才能使用管控功能。 -#### iLogtail 配置 ConfigServer -打开 iLogtail 目录下的 ilogtail_config.json 文件,配置 ConfigServer 相关参数 `ilogtail_configserver_address` 和 `ilogtail_tags`。 - -`ilogtail_configserver_address` 是 ConfigServer 部署的地址与端口号,可以配置多个 ConfigServer 地址, iLogtail 将自动切换选择可以链接的 ConfigServer。需要注意的是,目前的 ConfigServer 仅支持单机版,`ilogtail_configserver_address` 即使配置了多个地址,多个 ConfigServer 之间也并不支持数据同步。我们预留了 ConfigServer 支持分布式部署的扩展性,欢迎社区积极贡献开发。 - -`ilogtail_tags` 是 iLogtail 在 ConfigServer 处的标签,支持配置多个。虽然该参数暂时无法使用,但我们同样预留了支持通过自定义标签分组管理 Agent 的扩展性。 - -下面是一个简单的配置示例。 - -```json -{ - ... - "ilogtail_configserver_address" : [ - "127.0.0.1:8899" - ], - ... -} -``` - -### Service - -Service 为分布式的结构,支持多地部署,负责与采集 Agent 和用户/ui 通信,实现了管控的核心能力。 - -#### 启动 - -从 GitHub 下载 iLogtail 源码,进入 ConfigServer 后端目录下,编译运行代码。 - -``` bash -cd config_server/service -go build -o ConfigServer -nohup ./ConfigServer > stdout.log 2> stderr.log & -``` - -#### 配置选项 - -配置文件为 `config_server/service/seeting/setting.json`。可配置项如下: - -* `ip`:Service 服务启动的 ip 地址,默认为 `127.0.0.1`。 -* `port`:Service 服务启动的端口,默认为 `8899`。 -* `store_mode`:数据持久化的工具,默认为 `leveldb`。当前仅支持基于 leveldb 的单机数据持久化。 -* `db_path`:数据持久化的存储地址或数据库连接字符串,默认为 `./DB`。 -* `agent_update_interval`:将采集 Agent 上报的数据批量写入存储的时间间隔,单位为秒,默认为 `1` 秒。 -* `config_sync_interval`:Service 从存储同步采集 Config 的时间间隔,单位为秒,默认为 `3` 秒。 - -配置样例: - -```json -{ - "ip":"127.0.0.1", - "store_mode": "leveldb", - "port": "8899", - "db_path": "./DB", - "agent_update_interval": 1, - "config_sync_interval": 3 -} -``` - -### UI - -UI 为一个 Web 可视化界面,与 Service 连接,方便用户对采集 Agent 进行管理。 - -#### 快速开始 - -```shell -git clone https://github.com/iLogtail/config-server-ui -cd config-server-ui -yarn install -yarn start -``` - -#### 更多信息 - -请参考[这里](https://github.com/iLogtail/config-server-ui/blob/master/README.md) diff --git a/docs/cn/config-server/service.md b/docs/cn/config-server/service.md new file mode 100644 index 0000000000..1460f09737 --- /dev/null +++ b/docs/cn/config-server/service.md @@ -0,0 +1,76 @@ +# Config-server + +本项目针对https://github.com/alibaba/ilogtail/tree/main/config_server/protocol/v2 中提到的Agent行为进行了V2版本的适配,基本实现了能力报告、心跳压缩、配置状态上报等功能;并适配用户端实现了Config-server的前端页面Config-server-ui,项目见[ui](ui.md)。 + +## 快速开始 + +### 基本配置 + +下载ilogtail源码,进入`config_server/service`目录 + +#### 数据库配置 + +由于要求ConfigServer存储Agent的基本信息、PipelineConfig、InstanceConfig等配置信息,所以首先需要对数据库进行配置。打开`cmd/config/prod`文件夹,编辑`databaseConfig.json`(若不存在,请先创建),填入以下信息,其中`type`为数据库的基本类型 (基于gorm我们适配了`mysql`、`sqlite`、`postgres`、`sqlserver`四种数据库);其余均为数据库配置信息;`autoMigrate`字段默认为`true`,若先前建好业务相关的表,则设置为`false`。配置完成后,请自行创建可与ConfigServer连通的数据库实例,并创建名字为`dbName`的数据库(若按照docker compose方式启动,无需任何操作,参考[deployment](deployment.md))。 + +```json +{ + "type": "mysql", + "userName": "root", + "password": "123456", + "host": "mysql", + "port": 3306, + "dbName": "test", + "autoMigrate": true +} +``` + +#### ConfigServer配置 + +打开`cmd/config/prod`文件夹,编辑`serverConfig.json`(若不存在,请先创建),填入以下信息,其中`address`为应用程序运行的ip和端口;`capabilities`标识Server端拥有的能力,`responseFlags`支持两种配置采集方式,详情见[protocol](https://github.com/alibaba/ilogtail/blob/main/config_server/protocol/v2/README.md);若长时间没接收到某个Agent的心跳检测(超时上限为`timeLimit`,单位是秒),server端自动下线该Agent。 + +```json +{ + "address": "0.0.0.0:9090", + "capabilities": { + "rememberAttribute": true, + "rememberPipelineConfigStatus": true, + "rememberInstanceConfigStatus": true, + "rememberCustomCommandStatus": false + }, + "responseFlags": { + "fetchPipelineConfigDetail": true, + "fetchInstanceConfigDetail": false + }, + "timeLimit":60 +} +``` + +### 运行 + +按照**基本配置**进行数据库与ConfigServer的配置,进入根目录,运行下面的命令 + +```shell +go build -o ConfigServer ./cmd + +./ConfigServer +``` +本项目同样支持docker方式启动应用,Dockerfile见`Dockerfile`(不建议使用,通过docker compose一键部署脚本,可以更快实现应用搭建,参考[deployment](deployment.md))。 +### 启动Agent + +Agent 侧需要配置 ConfigServer 信息,才能使用管控功能。从[releases](https://github.com/alibaba/ilogtail/releases) 下载latest版本,配置`ilogtail_config.json`(若不存在,请先创建),添加如下信息,其中`endpoint_list`为ConfigServer的集群地址,并启动Agent。 +```json +{ + "config_server_list": [ + { + "cluster": "community", + "endpoint_list": [ + "127.0.0.1:9090" + ] + } + ] +} +``` +若Agent以docker方式启动(安装与启动见[start-with-container](https://github.com/alibaba/ilogtail/blob/main/docs/cn/installation/start-with-container.md)),务必保证Agent与ConfigServer的网络连通,可选择以下两种配置方案: +* 启动时配置Agent与ConfigServer在同一docker网络`server`中,此时`endpoint_list:["config-server:9090"]`。 +* 启动时配置`docker.internal.host`映射,此时`endpoint_list:["docker.internal.host:9090"]`。 + diff --git a/docs/cn/config-server/ui.md b/docs/cn/config-server/ui.md new file mode 100644 index 0000000000..3517ae86e6 --- /dev/null +++ b/docs/cn/config-server/ui.md @@ -0,0 +1,14 @@ +# Config-server-ui +这是基于阿里巴巴 iLogtail 项目 Config Server v2通信协议的一个前端实现。使用 Vue + Element plus 组件库 + Vue cli 脚手架工具进行开发,旨在为用户提供一个简单、实用、易嵌入的 Config Server 前端控制台。后端(Config Server)见[service](service.md)。 +## 快速开始 + +下载ilogtail源码,进入`config_server/ui`目录,打开`.env`文件,修改`${CONFIG_SERVER}`为后端可访问的URL(如http://127.0.0.1:9090,具体见[service](service.md)),运行下面命令 + +```shell +npm install +npm run serve +``` + +启动成功后,通过`http://{your-ip}:8080`即可实现前端页面的访问 + +本项目同样支持docker方式启动应用,Dockerfile见`Dockerfile`(不建议使用,通过docker-compose一键部署脚本,可以更快实现应用搭建,参考[deployment](deployment.md)。 \ No newline at end of file From 754ef22bd61bf321a1787cbba1798695131a40a7 Mon Sep 17 00:00:00 2001 From: Ww67652 <1749113286@qq.com> Date: Mon, 30 Sep 2024 22:31:51 +0800 Subject: [PATCH 3/8] update: delete agent config in docker-compose.yml --- config_server/deployment/docker-compose.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/config_server/deployment/docker-compose.yml b/config_server/deployment/docker-compose.yml index 5a0b1323aa..b6f3a0683b 100644 --- a/config_server/deployment/docker-compose.yml +++ b/config_server/deployment/docker-compose.yml @@ -50,19 +50,6 @@ services: networks: - server -# 通过下面的服务启动ilogtail agent的docker版本,并与config-server成功通信,具体配置流程见readme - agent: - build: - context: ${AGENT} - dockerfile: Dockerfile-Agent - image: ilogtail:nzh - environment: - CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' - TZ: Asia/Shanghai - deploy: - replicas: 3 - networks: - - server #替换成你自己的网络 networks: From d6e2ff36e7bcff5aae6620bdbcf4e3670b14e963 Mon Sep 17 00:00:00 2001 From: Ww67652 <1749113286@qq.com> Date: Mon, 21 Oct 2024 13:41:00 +0800 Subject: [PATCH 4/8] clean: clean useless code --- config_server/deployment/.env | 2 +- config_server/deployment/docker-compose.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/config_server/deployment/.env b/config_server/deployment/.env index 6b501c5b35..2b87857a08 100644 --- a/config_server/deployment/.env +++ b/config_server/deployment/.env @@ -2,5 +2,5 @@ CONFIG_SERVER=../service CONFIG_SERVER_UI=../ui # 需把该目录下的Dockerfile-agent复制到agent对应的目录下,并修改${AGENT}为agent所在目录路径 -AGENT=/home/ilogtail-2.0.7 +AGENT=/home/source-code AGENT_DEV_DOCKERFILE=/home/nzh/ilogtail/config_server/deployment/Dockerfile-Agent \ No newline at end of file diff --git a/config_server/deployment/docker-compose.yml b/config_server/deployment/docker-compose.yml index b6f3a0683b..8fbad9eeaf 100644 --- a/config_server/deployment/docker-compose.yml +++ b/config_server/deployment/docker-compose.yml @@ -50,7 +50,6 @@ services: networks: - server - #替换成你自己的网络 networks: server: From c91fdc23d1e7bd688932f5582c4250b4ecbd288c Mon Sep 17 00:00:00 2001 From: ww67652 <1749113286@qq.com> Date: Mon, 28 Oct 2024 11:17:11 +0800 Subject: [PATCH 5/8] feat: modify docker-compose.yml --- config_server/deployment/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config_server/deployment/docker-compose.yml b/config_server/deployment/docker-compose.yml index 8fbad9eeaf..cdc5d7f10e 100644 --- a/config_server/deployment/docker-compose.yml +++ b/config_server/deployment/docker-compose.yml @@ -49,7 +49,6 @@ services: - "host.docker.internal:host-gateway" networks: - server - #替换成你自己的网络 networks: server: From e2eb2113c03217d63d7442f2c66b0133c0b37e16 Mon Sep 17 00:00:00 2001 From: ww67652 <1749113286@qq.com> Date: Mon, 28 Oct 2024 11:43:21 +0800 Subject: [PATCH 6/8] modify the image tag in deployment --- config_server/deployment/.env | 3 +-- config_server/deployment/README.md | 9 +++------ config_server/deployment/docker-compose.yml | 4 ++-- docs/cn/config-server/deployment.md | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/config_server/deployment/.env b/config_server/deployment/.env index 2b87857a08..d99ed73a9e 100644 --- a/config_server/deployment/.env +++ b/config_server/deployment/.env @@ -2,5 +2,4 @@ CONFIG_SERVER=../service CONFIG_SERVER_UI=../ui # 需把该目录下的Dockerfile-agent复制到agent对应的目录下,并修改${AGENT}为agent所在目录路径 -AGENT=/home/source-code -AGENT_DEV_DOCKERFILE=/home/nzh/ilogtail/config_server/deployment/Dockerfile-Agent \ No newline at end of file +AGENT=/home/source-code \ No newline at end of file diff --git a/config_server/deployment/README.md b/config_server/deployment/README.md index 7815f86214..b9fdb62857 100644 --- a/config_server/deployment/README.md +++ b/config_server/deployment/README.md @@ -12,18 +12,16 @@ docker compose -f docker-compose.yml up -d 启动成功后,通过`http://{your-ip}:8080`即可实现前端页面的访问 -![config-server-ui](../ui/public/config-server-ui.png) - ## Agent启动 -为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, +由于最新版本的[ilogtail](https://github.com/alibaba/ilogtail/releases/tag/v2.0.7)(截止到2.0.7)尚未提供支持v2心跳的功能,为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, 修改`.env`中的`${AGENT}`为Agent所在目录路径(Agent安装与启动见[quick-start](https://github.com/alibaba/ilogtail/blob/main/docs/cn/installation/quick-start.md)),并在`docker-compose.yml`添加 ```yml agent: build: context: ${AGENT} dockerfile: Dockerfile-Agent - image: ilogtail:nzh + image: ilogtail:openSource environment: CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' TZ: Asia/Shanghai @@ -37,5 +35,4 @@ docker compose -f docker-compose.yml up -d ```shell docker compose -f docker-compose.yml up -d -``` - +``` \ No newline at end of file diff --git a/config_server/deployment/docker-compose.yml b/config_server/deployment/docker-compose.yml index cdc5d7f10e..7a6c893fb3 100644 --- a/config_server/deployment/docker-compose.yml +++ b/config_server/deployment/docker-compose.yml @@ -23,7 +23,7 @@ services: context: ${CONFIG_SERVER} dockerfile: Dockerfile # 如果之前构建过镜像,再次docker compose则不会重新构建 - image: config-server:nzh + image: config-server:openSource ports: - "9090:9090" environment: @@ -40,7 +40,7 @@ services: build: context: ${CONFIG_SERVER_UI} dockerfile: Dockerfile - image: config-server-ui:nzh + image: config-server-ui:openSource ports: - "8080:8080" environment: diff --git a/docs/cn/config-server/deployment.md b/docs/cn/config-server/deployment.md index e7e93e591a..f026ad22a1 100644 --- a/docs/cn/config-server/deployment.md +++ b/docs/cn/config-server/deployment.md @@ -14,14 +14,14 @@ docker compose -f docker-compose.yml up -d ## Agent启动 -为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, +由于最新版本的[ilogtail](https://github.com/alibaba/ilogtail/releases/tag/v2.0.7)(截止到2.0.7)尚未提供支持v2心跳的功能,为了便于使用(测试)`config-server-ui`,本项目提供了基于docker启动Agent的脚本,复制`Dockefile-Agent`与`ilogtail_config.template.json`到Agent的目录下, 修改`.env`中的`${AGENT}`为Agent所在目录路径(Agent安装与启动见[quick-start](https://github.com/alibaba/ilogtail/blob/main/docs/cn/installation/quick-start.md)),并在`docker-compose.yml`添加 ```yml agent: build: context: ${AGENT} dockerfile: Dockerfile-Agent - image: ilogtail:nzh + image: ilogtail:openSource environment: CONFIG_SERVER_ADDRESSES: '["config-server:9090"]' TZ: Asia/Shanghai From ab198067a73f88ca34f39c639eb476042789b97c Mon Sep 17 00:00:00 2001 From: ww67652 <1749113286@qq.com> Date: Mon, 28 Oct 2024 11:44:58 +0800 Subject: [PATCH 7/8] modify the image tag in deployment --- .../deployment/docker-compose-dev.yml | 65 ------------------- 1 file changed, 65 deletions(-) delete mode 100644 config_server/deployment/docker-compose-dev.yml diff --git a/config_server/deployment/docker-compose-dev.yml b/config_server/deployment/docker-compose-dev.yml deleted file mode 100644 index 3b1f84db4f..0000000000 --- a/config_server/deployment/docker-compose-dev.yml +++ /dev/null @@ -1,65 +0,0 @@ -version: '3.8' -services: - mysql: - image: mysql:latest - volumes: - - /var/lib/mysql:/var/lib/mysql - ports: - - "3306:3306" - environment: - MYSQL_ROOT_PASSWORD: "123456" - cap_add: - - SYS_NICE - networks: - - server - - config-server-dev: - build: - context: ${CONFIG_SERVER} - #Dockerfile指定了context后,若不使用全局路径,则为context的相对路径 - dockerfile: Dockerfile-dev - image: config-server-dev:nzh - #替换成你代码的位置 - volumes: - - ${CONFIG_SERVER}:/backend - ports: - - "9090:9090" - environment: - TZ: Asia/Shanghai - networks: - - server - depends_on: - - mysql - - agent-dev: - build: - #确保目录下有agent - context: ${AGENT} - dockerfile: ${AGENT_DEV_DOCKERFILE} - image: ilogtail-dev:nzh - environment: - CONFIG_SERVER_ADDRESSES: '["host.docker.internal:9090"]' - TZ: Asia/Shanghai - extra_hosts: - - "host.docker.internal:host-gateway" - deploy: - replicas: 2 - networks: - - server - - config-server-ui: - build: - context: ${CONFIG_SERVER_UI} - dockerfile: Dockerfile - image: config-server-ui:nzh - ports: - - "8080:8080" - environment: - TZ: Asia/Shanghai - extra_hosts: - - "host.docker.internal:host-gateway" - networks: - - server - -networks: - server: From dfc1b24e064bd08c1273422af42e24732fd50ab3 Mon Sep 17 00:00:00 2001 From: ww67652 <1749113286@qq.com> Date: Wed, 30 Oct 2024 12:59:27 +0800 Subject: [PATCH 8/8] refactor deployment directory --- config_server/{ => v2}/deployment/.env | 0 config_server/{ => v2}/deployment/Dockerfile-Agent | 0 config_server/{ => v2}/deployment/README.md | 0 config_server/{ => v2}/deployment/docker-compose.yml | 0 config_server/{ => v2}/deployment/ilogtail_config.template.json | 0 docs/cn/config-server/deployment.md | 2 +- docs/cn/config-server/service.md | 2 +- docs/cn/config-server/ui.md | 2 +- 8 files changed, 3 insertions(+), 3 deletions(-) rename config_server/{ => v2}/deployment/.env (100%) rename config_server/{ => v2}/deployment/Dockerfile-Agent (100%) rename config_server/{ => v2}/deployment/README.md (100%) rename config_server/{ => v2}/deployment/docker-compose.yml (100%) rename config_server/{ => v2}/deployment/ilogtail_config.template.json (100%) diff --git a/config_server/deployment/.env b/config_server/v2/deployment/.env similarity index 100% rename from config_server/deployment/.env rename to config_server/v2/deployment/.env diff --git a/config_server/deployment/Dockerfile-Agent b/config_server/v2/deployment/Dockerfile-Agent similarity index 100% rename from config_server/deployment/Dockerfile-Agent rename to config_server/v2/deployment/Dockerfile-Agent diff --git a/config_server/deployment/README.md b/config_server/v2/deployment/README.md similarity index 100% rename from config_server/deployment/README.md rename to config_server/v2/deployment/README.md diff --git a/config_server/deployment/docker-compose.yml b/config_server/v2/deployment/docker-compose.yml similarity index 100% rename from config_server/deployment/docker-compose.yml rename to config_server/v2/deployment/docker-compose.yml diff --git a/config_server/deployment/ilogtail_config.template.json b/config_server/v2/deployment/ilogtail_config.template.json similarity index 100% rename from config_server/deployment/ilogtail_config.template.json rename to config_server/v2/deployment/ilogtail_config.template.json diff --git a/docs/cn/config-server/deployment.md b/docs/cn/config-server/deployment.md index f026ad22a1..f5141446d5 100644 --- a/docs/cn/config-server/deployment.md +++ b/docs/cn/config-server/deployment.md @@ -4,7 +4,7 @@ ## 快速开始 -下载ilogtail源码,进入`config_server/deployment`目录,运行`deployment-compose.yml`,启动三个容器(`mysql`、`config-server`、`config-server-ui`) +下载ilogtail源码,进入`config_server/v2/deployment`目录,运行`deployment-compose.yml`,启动三个容器(`mysql`、`config-server`、`config-server-ui`) ```shell docker compose -f docker-compose.yml up -d diff --git a/docs/cn/config-server/service.md b/docs/cn/config-server/service.md index 1460f09737..411949791a 100644 --- a/docs/cn/config-server/service.md +++ b/docs/cn/config-server/service.md @@ -6,7 +6,7 @@ ### 基本配置 -下载ilogtail源码,进入`config_server/service`目录 +下载ilogtail源码,进入`config_server/v2/service`目录 #### 数据库配置 diff --git a/docs/cn/config-server/ui.md b/docs/cn/config-server/ui.md index 3517ae86e6..0b738f4be3 100644 --- a/docs/cn/config-server/ui.md +++ b/docs/cn/config-server/ui.md @@ -2,7 +2,7 @@ 这是基于阿里巴巴 iLogtail 项目 Config Server v2通信协议的一个前端实现。使用 Vue + Element plus 组件库 + Vue cli 脚手架工具进行开发,旨在为用户提供一个简单、实用、易嵌入的 Config Server 前端控制台。后端(Config Server)见[service](service.md)。 ## 快速开始 -下载ilogtail源码,进入`config_server/ui`目录,打开`.env`文件,修改`${CONFIG_SERVER}`为后端可访问的URL(如http://127.0.0.1:9090,具体见[service](service.md)),运行下面命令 +下载ilogtail源码,进入`config_server/v2/ui`目录,打开`.env`文件,修改`${CONFIG_SERVER}`为后端可访问的URL(如http://127.0.0.1:9090,具体见[service](service.md)),运行下面命令 ```shell npm install