mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-13 02:26:36 +08:00
feat(openflare): migrate of_node_access_logs to ClickHouse
Move node access log storage from PostgreSQL/SQLite to ClickHouse (database: openflare). System startup now requires a healthy ClickHouse connection and auto-initializes the schema. Agent heartbeat writes access logs via batch insert; goose migration drops the legacy relational table.
This commit is contained in:
@@ -31,6 +31,10 @@ func init() {
|
||||
}
|
||||
|
||||
cfg := config.Config.ClickHouse
|
||||
if cfg.Database == "" {
|
||||
log.Fatalf("[ClickHouse] database name is required (expected: openflare)\n")
|
||||
}
|
||||
|
||||
var err error
|
||||
|
||||
// 配置 ClickHouse 连接
|
||||
@@ -64,5 +68,6 @@ func init() {
|
||||
log.Fatalf("[ClickHouse] ping failed: %v\n", err)
|
||||
}
|
||||
|
||||
ensureClickHouseSchemaOnStartup()
|
||||
log.Println("[ClickHouse] connection established successfully")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user