Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update: add service for v2 protocol (ConfigServer) #1793

Open
wants to merge 8 commits into
base: ospp_dev
Choose a base branch
from

Conversation

ww67652
Copy link

@ww67652 ww67652 commented Sep 29, 2024

No description provided.

@@ -0,0 +1,69 @@
# Config-server

本项目针对https://github.com/alibaba/ilogtail/tree/main/config_server/protocol/v2 中提到的Agent行为进行了V2版本的适配,基本实现了能力报告、心跳压缩、配置状态上报等功能;并适配用户端实现了Config-server的前端页面Config-server-ui,项目见[ui](../ui/README.md)。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文档移到docs目录里,注意把对应的链接修改一下。另外markdown格式化一下

下载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/README.md))。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leveldb还支持吗

config_server/service/Dockerfile Outdated Show resolved Hide resolved
FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/ilogtail-community-edition/ilogtail-build-linux:2.0.3 as build

USER root
WORKDIR /backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的目录变了,得改一下

config_server/service/router/router.go Outdated Show resolved Hide resolved
config_server/service/router/router.go Outdated Show resolved Hide resolved
config_server/service/router/router.go Outdated Show resolved Hide resolved
@Takuka0311
Copy link
Collaborator

yysy,这个go代码一股子java味。。。

func TestProto(t *testing.T) {
//NewObj[protov2.CreateAgentGroupRequest]()
NewObj[*protov2.CreateAgentGroupRequest]()
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你把test都删了,结果只剩这么点test。。。原本的test里带有一些业务逻辑的,尤其是interface_test.go,看看有没有时间把测试补回来

config_server/service/handler/common.go Outdated Show resolved Hide resolved
config_server/service/common/http_status.go Outdated Show resolved Hide resolved
"path/filepath"
)

type ServerConfig struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个配置跟之前的版本完全不一样了。。。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最基础的兼容还是要做的,因为也要适配v1的协议

"path/filepath"
)

type GormConfig struct {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

老的leveldb的版本需要适配,不然没办法平滑升级

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

兼容性问题我再讨论下,涉及的意见先不用处理

"time"
)

func JudgeSequenceNumRationality(instanceId []byte, sequenceNum uint64) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在PR里标注一下,主要的协议相关的重点逻辑在哪些目录/文件吧,review起来方便一点

@Takuka0311 Takuka0311 changed the base branch from main to ospp_dev October 30, 2024 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants