mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-31 05:05:33 +08:00
- 6 张表加 node_id 字段 + position/stat 改复合唯一键(migration) - 6 个 Scheme 同步 node_id 注解 + 唯一键 - Reader 带 node_id 参数 + 懒加载接管(getLastPosition 回退查 node_id='') - Aggregator 全局行(node_id='')+ 按节点循环 insertAggregatesForScope - Stat 所有查询方法加 where node_id 条件 - Dashboard 控制器/视图加节点筛选下拉框 + AJAX 带 node_id - AccessLog 列表加节点列 + 采集进度卡片显示节点信息 - import 定时任务 run_type 改 all(每节点采集自己的日志) - v2.4.0 升级脚本追加 ALTER TABLE(幂等 check-then-alter) - 菜单调整:去掉 Nginx 顶级菜单 + 读取位置管理,改为系统管理下挂两个子菜单 - ulthon-timer 文档补充 run_type=all 多节点部署注意事项
57 lines
2.2 KiB
PHP
57 lines
2.2 KiB
PHP
<?php
|
||
|
||
namespace app\admin\scheme;
|
||
|
||
use app\common\scheme\BaseScheme;
|
||
use app\common\scheme\attribute\Table;
|
||
use app\common\scheme\attribute\Field;
|
||
use app\common\scheme\attribute\Component;
|
||
use app\common\scheme\attribute\Index;
|
||
|
||
#[Table(name: 'ul_nginx_log_position', comment: 'nginx 日志文件读取位置(增量读取状态)')]
|
||
#[Index(columns: ['node_id', 'file_path'], name: 'uniq_node_file', type: 'UNIQUE')]
|
||
class NginxLogPosition extends BaseScheme
|
||
{
|
||
#[Field(type: 'int', length: 11, nullable: false, unsigned: true, autoIncrement: true, primary: true)]
|
||
public $id;
|
||
|
||
#[Field(type: 'varchar', length: 64, nullable: false, default: '', comment: '节点ID(区分不同采集节点)')]
|
||
public $node_id;
|
||
|
||
#[Field(type: 'varchar', length: 500, nullable: false, comment: '日志文件绝对路径')]
|
||
#[Component(type: 'text', options: [])]
|
||
public $file_path;
|
||
|
||
#[Field(type: 'bigint', default: '0', unsigned: true, comment: '文件 inode,用于检测日志轮转')]
|
||
#[Component(type: 'text', options: [])]
|
||
public $inode;
|
||
|
||
#[Field(type: 'bigint', default: '0', unsigned: true, comment: '上次读取到的字节偏移')]
|
||
#[Component(type: 'text', options: [])]
|
||
public $offset;
|
||
|
||
#[Field(type: 'int', length: 11, default: '0', unsigned: true, comment: '上次读取时间戳')]
|
||
#[Component(type: 'date', options: [])]
|
||
public $last_read_time;
|
||
|
||
#[Field(type: 'varchar', length: 32, default: '', comment: '上次最后一行的 md5 哈希(容错校验)')]
|
||
#[Component(type: 'text', options: [])]
|
||
public $last_line_hash;
|
||
|
||
#[Field(type: 'int', length: 11, default: '0', unsigned: true, comment: '解析失败累计次数')]
|
||
#[Component(type: 'text', options: [])]
|
||
public $parse_fail_count;
|
||
|
||
#[Field(type: 'text', nullable: true, comment: '解析失败样本行(最多保留若干条)')]
|
||
#[Component(type: 'textarea', options: [])]
|
||
public $parse_fail_samples;
|
||
|
||
#[Field(type: 'int', length: 11, unsigned: true, comment: '创建时间戳')]
|
||
#[Component(type: 'date', options: [])]
|
||
public $create_time;
|
||
|
||
#[Field(type: 'int', length: 11, unsigned: true, comment: '更新时间戳')]
|
||
#[Component(type: 'date', options: [])]
|
||
public $update_time;
|
||
}
|