产品架构设计

最近更新时间: 2024-06-12 15:06:00

产品介绍

应用运维平台为部署在TCE上的租户业务应用提供业务发布、扩缩容、主机运维命令批量执行、统一资源管理CMDB能力,为应用全生命周期提供完善的运维解决方案,助力客户用好云。

技术优势

应用视角、开箱即用

TAP以应用为视角,围绕应用生命周期管理和发布运维,提供一站式的开箱即用产品能力。支持业务树定义、应用的云资源申请和关联、应用环境管理、虚拟机/容器应用发布,以及以应用为粒度的权限控制。

TCE深度集成

TAP是TCE上的云产品,账号登录体系和TCE一致。cmdb里提供了租户下所有云资源的统一管理,可以统一查看租户下的云资源使用情况。对平台申请的虚拟机资源关联应用并安装agent后,可以以应用视角对虚机进行白屏化运维操作和发布以及部署版本管理。解决企业对云平台使用时,对云资源和应用管理割裂的痛点,通过一站式运维提高企业运维效率。

开放性

TAP所有功能提供API可提供对外被集成。数据上cmdb里的资源数据、主机运维和业务运维里的运维数据、业务运维里的业务定义和人员权限等数据也都提供查询能力。cmdb里的资源变化也提供时时变化对外通知能力。

技术架构

整体设计

产品整体架构如图所示

分层架构

1、标准能力层组件代码仓库保持通用。场景化产品能力用新代码仓库作为扩展层。 2、标准能力-cmdb和基础平台提供独立产品化能力 3、标准能力-标准运维,依赖cmdb和基础平台,同时提供系统官方原子能力,同时支持3方系统接入并结合内部能力统一编排 4、主机运维&作业平台 相对独立,只依赖cmdb和基础平台 5、客户业务元数据导入通过扩容能力里的松耦合方式,插件化支持 6、业务运维的整个调度框架依赖标准运维,元数据以来cmdb和基础平台。作为对客户侧一站式运维入口产品形态

技术指标

产品详细设计

产品模块说明

模块 组件名称 功能介绍
业务运维 product-frontend-imgcache-tcloud-tap-app 业务运维前端组件
tap-app-manager 应用上/下线、环境管理、应用发布、扩缩、运维任务管理
tap-repo-proxy 制品库proxy
tap-repo 制品库后台服务
tap-generic-file-server 文件分发服务器
主机运维 tap-workflow-engine 任务引擎,主机运维里的批量执行等复杂流程操作控制
tcloud-tap-worktool 作业工具后端组件,提供快速执行脚本、快速文件分发、快速执行ansible等能力
product-frontend-imgcache-tcloud-tap-host 主机运维前端组件
cmdb tap-cmdb 资产管理系统。tce租户端所有云资源统一管理,并提供自定义模块能力。业务运维的业务树、资源关系的管理
product-frontend-imgcache-tcloud-tap-cmdb cmdb前端组件
基础平台 product-frontend-imgcache-tcloud-tap-common 安全设置、全局设置等前端组件
tap-remote-executor 远程执行命令通道后台组件
tap-agent-server agentserver管理后台组件
tap-chronoflow-order 统一任务调度后台组件

功能链路说明

通过用户上线和运维一个虚拟机应用的例子,来串联整个架构: 1、资源准备:cmdb资产管理系统tap-cmdb会同步TCE平台的所有云资源,对于虚拟机应用,是cvm资源和物理机资源列表。同时也可以在cmdb里导入云外主机资源。对主机资源,需要安装agent用于后续运维。 2、业务数据初始化:在业务运维tap-app-manager里定义产品-子系统-组件,以及设置相关的运维人员和属性,完成运维业务元数据的初始化。组件关联的制品地址会记录在制品管理tap-repo中。在环境管理里创建对应环境,内置测试、预发、生产3套环境,如需要可在页面添加。确认环境后,在对应环境里添加需要部署的产品-子系统-组件数据,进行实例化。 3、业务-资源关联:在tap-cmdb里,给对应产品-子系统-组件的环境下进行资源关联,可建立主机和应用的资源关联关系。 4、应用发布运维:选择要发布的组件、版本,会对应出现资源列表,选择制品版本后可提交发布。发布过程中,第一步会从制品管理tap-repo-proxy、tap-generic-file-server将制品下载到目标主机列表,后续发布通过基础平台的tap-remote-executor、tap-agent-server进行远程命令下发。整个发布流程的控制(并、串行节点的控制)由统一调度后台组件tap-chronoflow-order承载。 5、应用日常运维:批量执行脚本、命令、定时任务等能力通过主机运维tap-workflow-engine、tcloud-tap-worktool组件实现。

数据库设计

数据库环境说明

应用运维TAP统一使用TCE支撑tdsql作为数据库存储。

数据库命名规则

逻辑设计

物理设计

cmdb表汇总

对应模块 所属数据库名 表名 功能说明 序号
cmdb模型管理 tap_cmdb model 模型 1
model_field_display_mode 模型字段展示 2
model_group 模型分组 3
model_stats 模型统计信息表 4
property 字段 5
property_group 字段分组 6
unique_verification 字段唯一性校验表 7
id_generator 模型自增ID记录表 8
cmdb数据扩展管理功能 tap_cmdb auth cmdb自身资源访问管控 9
operation_log 审计日志 10
full_text_data 全文检索数据 11
cmdb业务树关联、环境数据 tap_cmdb env_info 环境信息 12
env_node_rel 节点环境关联表 13
env_resource_rel 环境关联资源表 14
environment_lock 环境锁表 15
biz_resource_relation 资产与业务树关联信息 16
node_topo 业务树拓扑模型表 17
node_workload_rel 组件关联工作负载表 18
CMDB数据管理 tap_cmdb instance 通用实例表 19
bms 裸金属服务器BMS 20
cbs 云硬盘CBS 21
cfs 文件存储CFS 22
clb 负载均衡CLB 23
host 云服务器CVM 24
tdsql_mysql 云原生关系型数据库 25
tke 容器服务TKE 26
vpc 私有网络VPC 27
redis 健值数据库Redis 28
node 业务树节点 29
cloud 云区域(环境基础信息) 30
region 地域(环境基础信息) 31
zone 可用区(环境基础信息) 32
idc 机房(环境基础信息) 33
cmdb同步功能 tap_cmdb cmdb_sync_config 同步任务配置 34
cmdb_sync_conflict 同步冲突数据 35
cmdb_sync_element 同步配置元素 36
cmdb_sync_history 同步历史记录 37
cmdb标签管理 tap_cmdb resource_tag 标签资产关联 38
tag 标签 39
cmdb权限管理 tap_cmdb role 角色 40
role_object 对象信息(接口) 41
role_operate 操作 42
role_resource_type 资源类型 43
role_service 服务 44
role_user 人员 - 角色关联表 45
role_user_resource 人员 - 资源实例关联表 46
cmdb回调管理
(事件订阅)
tap_cmdb event 事件管理 47
subscription 订阅列表 48
subscription_log 订阅推送日志 49
cmdb导入功能
(chronoflow)
tap_cmdb chronoflow_component 流程组件表 50
chronoflow_dag 流程实例表 51
chronoflow_dag_biz 流程实例业务数据 52
chronoflow_dag_biz_history 流程实例历史业务数据 53
chronoflow_dag_define 流程定义表 54
chronoflow_dag_history 流程实例历史 55
chronoflow_edge 流程实例节点关系 56
chronoflow_edge_define 流程定义节点关系 57
chronoflow_edge_history 流程定义节点关系历史 58
chronoflow_lock 流程实例调度锁 59
chronoflow_node 流程实例节点 60
chronoflow_node_biz 流程实例业务数据 61
chronoflow_node_biz_history 流程实例业务历史数据 62
chronoflow_node_define 流程定义节点定义表 63
chronoflow_node_history 流程定义节点历史表 64

CMDB表详情

create table auth ( component varchar(64) not null comment '组件名称', model_uuid varchar(64) not null comment '模型的uuid', create_permission tinyint(1) default 0 not null comment '新增实例的权限', delete_permission tinyint(1) default 0 not null comment '删除实例的权限', update_permission tinyint(1) default 0 not null comment '更新实例的权限', search_permission tinyint(1) default 0 not null comment '查询实例的权限' ) comment '内部组件鉴权表';

create table biz_resource_relation ( id int auto_increment primary key, node_uuid varchar(512) not null comment '业务树节点UUID', inst_model_uuid varchar(128) not null comment '实例模型UUID', inst_id int not null comment '实例ID', business_status varchar(64) null comment '业务状态', alarm tinyint(1) null comment '关联告警', import_from varchar(128) null comment '数据来源', operator varchar(255) null comment '操作者', env_node_id int null comment '租户端环境下的节点实例ID', node_version varchar(32) null comment '组件部署版本' ) comment '业务树资产关联表';

create index instIdIndex on biz_resource_relation (inst_id);

create index instModelUuidIndex on biz_resource_relation (inst_model_uuid);

create index modelUuidInstIdIndex on biz_resource_relation (inst_model_uuid, inst_id);

create table bms ( bms_id int unsigned auto_increment primary key, region_id int null comment '地域ID', project_id varchar(255) null comment '项目ID', project_name varchar(255) null comment '项目名称', region_name varchar(255) null comment '地域名字', zone_id int null comment '可用区ID', zone_name varchar(255) null comment '可用区名字', asset_id varchar(255) null comment '资产ID', sn varchar(255) null comment '序列号', host_status varchar(255) null comment '机器在CMDB的运行状态', mac varchar(255) null comment '机器MAC地址', aggregation_port varchar(255) null comment '聚合端口', disk json null comment '机器磁盘信息', name varchar(255) null comment '机器名称', bonding_flag varchar(255) null comment '网卡Bond标志', underlay_ip varchar(255) null comment '物理IP地址', underlay_mask varchar(255) null comment '物理IP地址掩码', underlay_gateway varchar(255) null comment '物理IP地址网关', switch_port_type varchar(255) null comment '交换机端口类型', switch_port_name varchar(255) null comment '交换机端口名字', switch_port_phy_name varchar(255) null comment '交换机物理端口名字', switch_sn json null comment '交换机资产信息', switch json null comment '交换机详细信息', task_state varchar(255) null comment 'BMS实例运行状态', flavor_info json null comment '绑定机型的详细信息', user_defined int null comment '自定义机型标志', app_id varchar(255) null comment '用户ID', vpc_id int null comment '虚拟私有网络ID', overlay_ip varchar(255) null comment '虚拟网络IP地址', overlay_mask varchar(255) null comment '虚拟IP地址掩码', sell_state varchar(255) null comment '售卖状态', bms_ins_id varchar(255) null comment '裸金属服务器ID(BMS提供)', bms_create_time varchar(255) null comment '创建时间', flavor_id varchar(255) null comment '机型ID', os_version varchar(255) null comment '操作系统版本', overlay_gateway varchar(255) null comment '虚拟IP地址网关', subnet_id int null comment '子网ID', idc_id int null comment '数据中心ID', idc_name varchar(255) null comment '数据中心名字', device_type varchar(255) null comment '服务器机型', cpu_arch varchar(255) null comment 'CPU型号,X86/ARM', os_type varchar(255) null comment '系统类型', power_state varchar(255) null comment '电源情况', hostname varchar(255) null comment '主机名', raid varchar(255) null comment 'Raid信息', schedule_weight int null comment '下次分配权重', nic_id varchar(255) null comment 'nic信息', uuid varchar(255) null comment '当前使用者的Uuid', sxgw_ip varchar(255) null comment '当前上联sxgw网关的VIP', xgw_ip varchar(255) null comment '当前上联xgw网关的VIP', tag json null comment '绑定标签信息', ilo_ip varchar(255) null comment 'IloIp信息', instance_name varchar(255) null comment '申请的主机名', region int null comment '地域IP', rack varchar(255) null comment '机架名称', heart_port varchar(255) null comment '心跳交换机端口', heart_port_name varchar(255) null comment '心跳交换机端口名', backup_ip_s varchar(255) null comment '备用IP', account_id varchar(255) null comment '用于标识客户端请求的来源,即用户账号ID。', create_time datetime null comment '创建时间', destroyed int default 0 null comment '是否被清理', custom_extensions json null comment '客户自定义字段预留列', maintainer varchar(255) null comment '负责人', creator varchar(255) null comment '创建人' );

create table cbs ( cbs_id int auto_increment comment 'id' primary key, disk_name varchar(255) null comment '云硬盘名称', maintainer varchar(255) null comment '负责人', disk_id varchar(255) null comment '云硬盘ID', disk_type varchar(64) null comment '硬盘介质类型。', disk_state varchar(64) null comment '云盘状态', disk_size int null comment '云硬盘大小,单位GB', disk_usage varchar(64) null comment '云硬盘类型', tags json null comment '与云盘绑定的标签', instance_id varchar(255) null comment '云硬盘挂载的云主机ID', zone_name varchar(255) null comment '云硬盘所属的可用区', region_name varchar(255) null comment '所属地域', project_name varchar(255) null comment '实例所属项目名称', project_id varchar(255) null comment '实例所属项目ID', account_id varchar(255) null, create_time datetime null, creator varchar(255) null, update_time datetime null, custom_extensions varchar(255) null, cbs_create_time varchar(255) null comment 'cbs创建时间', app_id varchar(255) null comment '属于哪个应用', destroyed int default 0 null comment '是否被清理' ) comment '云硬盘';

create table cfs ( cfs_id int auto_increment comment 'ID' primary key, file_system_id varchar(64) null comment '实例ID', creation_token varchar(255) null comment '名称', account_id varchar(64) null comment '属于哪个主账号', maintainer varchar(255) null comment '负责人', uin varchar(64) null comment '属于哪个主账号', app_id varchar(64) null comment '应用ID', zone_id int null comment '可用区ID', old_cfs_id varchar(64) null comment '原始CFS ID', vpc_id int null comment '私有网络 ID', subnet_id int null comment '子网 ID', life_cycle_state varchar(64) null comment '文件系统状态', used_size int null comment '已使用容量(GiB)', size_byte bigint null comment '大小字节', alloc_size bigint null comment '已分配容量(GiB)', alloc_limit bigint null comment '容量上限(GiB)', alloc_limit_max bigint null comment '最大容量上限(GiB)', protocol varchar(255) null comment '协议', storage_type varchar(64) null comment '存储类型', version varchar(255) null comment '版本', traffic_control varchar(64) null comment '流控模式', snap_status varchar(64) null comment '快照状态', task_id varchar(64) null comment '任务 ID', disk_uuid varchar(255) null comment '磁盘 UUID', cfs_cluster_id int null comment '服务器 ID', server_id int null comment '服务器 ID', region varchar(255) null comment '地域', region_name varchar(255) null comment '地域', zone_name varchar(255) null comment '可用区名称', agent_ip varchar(255) null comment 'Agent IP', set_id bigint null comment 'Set Id', read_iops_max bigint null comment '最大读取 IOPS', write_iops_max bigint null comment '最大写入 IOPS', read_bw_max bigint null comment '最大读取带宽(MB/s)', write_bw_max bigint null comment '最大写入带宽(MB/s)', task_status varchar(255) null comment '任务状态', permission_group_id varchar(255) null comment '权限组id', net_type varchar(255) null comment '网络类型', uniq_vpc_id varchar(255) null comment 'VPC 的唯一 ID', uniq_subnet_id varchar(255) null comment '子网的唯一 ID', ip_address varchar(255) null comment 'IP 地址', tag_name varchar(255) null comment '所属资源池', cvm_count bigint null comment 'CVM 数量', inode_total bigint null comment '索引节点总计', inode_free bigint null comment '空闲索引节点数量', inode_used bigint null comment '已用索引节点数量', cfs_create_time varchar(255) null comment '创建时间', cfs_update_time varchar(255) null comment '更新时间', create_time datetime null comment '创建时间', update_time datetime null comment '更新时间', custom_extensions json null comment '客户自定义字段预留列', destroyed int null comment '是否被清理' ) comment 'CFS文件存储信息';

create table chronoflow_component ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, namespace varchar(64) null, service_name varchar(128) null, display_name varchar(255) null, component_type varchar(64) null, service_type varchar(64) null, query_conf text null, retry_conf text null, input_params text null, output_params text null ) charset = utf8mb4;

create index create_time on chronoflow_component (created_at);

create index idx_namespace on chronoflow_component (namespace);

create index idx_service_name on chronoflow_component (service_name);

create index update_time on chronoflow_component (updated_at);

create table chronoflow_dag ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_name varchar(128) null, dag_type varchar(128) null, dag_desc text null, version bigint null, expire_time bigint null, input text null, label text null, biz text null, status varchar(64) null, result varchar(64) null, log text null, start_time datetime(3) null, finish_time datetime(3) null, timeout bigint null, arrange_type varchar(64) null ) charset = utf8mb4;

create index create_time on chronoflow_dag (created_at);

create index idx_dag_name on chronoflow_dag (dag_name);

create index idx_namespace on chronoflow_dag (namespace);

create index update_time on chronoflow_dag (updated_at);

create table chronoflow_dag_biz ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_id bigint unsigned null, namespace varchar(64) null, field varchar(128) null, label varchar(255) null, value text null, mark text null, option text null ) charset = utf8mb4;

create index create_time on chronoflow_dag_biz (created_at);

create index idx_dag_id on chronoflow_dag_biz (dag_id);

create index idx_field on chronoflow_dag_biz (field);

create index idx_namespace on chronoflow_dag_biz (namespace);

create index update_time on chronoflow_dag_biz (updated_at);

create table chronoflow_dag_biz_history ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_id bigint unsigned null, namespace varchar(64) null, field varchar(128) null, label varchar(255) null, value text null, mark text null, option text null ) charset = utf8mb4;

create index create_time on chronoflow_dag_biz_history (created_at);

create index update_time on chronoflow_dag_biz_history (updated_at);

create table chronoflow_dag_define ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, namespace varchar(64) null, dag_name varchar(128) null, dag_type varchar(128) null, dag_desc text null, label text null, layout text null, timeout bigint null, arrange_type varchar(64) null, revise varchar(64) null, constraint uk_namespace_name_revise unique (namespace, dag_name, revise) ) charset = utf8mb4;

create index create_time on chronoflow_dag_define (created_at);

create index update_time on chronoflow_dag_define (updated_at);

create table chronoflow_dag_history ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_name varchar(128) null, dag_type varchar(128) null, dag_desc text null, version bigint null, expire_time bigint null, input text null, label text null, biz text null, status varchar(64) null, result varchar(64) null, log text null, start_time datetime(3) null, finish_time datetime(3) null, timeout bigint null, arrange_type varchar(64) null ) charset = utf8mb4;

create index create_time on chronoflow_dag_history (created_at);

create index update_time on chronoflow_dag_history (updated_at);

create table chronoflow_edge ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_id bigint unsigned null, parent_node_name varchar(128) null, node_name varchar(128) null ) charset = utf8mb4;

create index create_time on chronoflow_edge (created_at);

create index idx_dag_id on chronoflow_edge (dag_id);

create index idx_namespace on chronoflow_edge (namespace);

create index idx_node_name on chronoflow_edge (node_name);

create index idx_parent_node_name on chronoflow_edge (parent_node_name);

create index update_time on chronoflow_edge (updated_at);

create table chronoflow_edge_define ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_def_id bigint unsigned null, namespace varchar(64) null, parent_node_name varchar(128) null, node_name varchar(128) null ) charset = utf8mb4;

create index create_time on chronoflow_edge_define (created_at);

create index idx_namespace on chronoflow_edge_define (namespace);

create index update_time on chronoflow_edge_define (updated_at);

create table chronoflow_edge_history ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_id bigint unsigned null, parent_node_name varchar(128) null, node_name varchar(128) null ) charset = utf8mb4;

create index create_time on chronoflow_edge_history (created_at);

create index update_time on chronoflow_edge_history (updated_at);

create table chronoflow_lock ( key varchar(128) not null primary key, expire_time bigint null, uid varchar(64) null, updated_at datetime(3) null ) charset = utf8mb4;

create index update_time on chronoflow_lock (updated_at);

create table chronoflow_node ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_id bigint unsigned null, node_name varchar(128) null, node_type varchar(64) null, service_name varchar(128) null, display_name varchar(255) null, input text null, output text null, biz text null, query_conf varchar(255) null, retry_conf bigint null, stage varchar(64) null, status varchar(64) null, result varchar(64) null, log text null, current tinyint(1) null, expire_time bigint null, query bigint null, retry bigint null, version bigint null, link_param text null, start_time datetime(3) null, finish_time datetime(3) null ) charset = utf8mb4;

create index create_time on chronoflow_node (created_at);

create index idx_dag_id on chronoflow_node (dag_id);

create index idx_namespace on chronoflow_node (namespace);

create index idx_node_name on chronoflow_node (node_name);

create index update_time on chronoflow_node (updated_at);

create table chronoflow_node_biz ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_id bigint unsigned null, node_id bigint unsigned null, node_name varchar(128) null, namespace varchar(64) null, field varchar(128) null, label varchar(255) null, value text null, mark text null, option text null ) charset = utf8mb4;

create index create_time on chronoflow_node_biz (created_at);

create index idx_dag_id on chronoflow_node_biz (dag_id);

create index idx_field on chronoflow_node_biz (field);

create index idx_namespace on chronoflow_node_biz (namespace);

create index idx_node_id on chronoflow_node_biz (node_id);

create index idx_node_name on chronoflow_node_biz (node_name);

create index update_time on chronoflow_node_biz (updated_at);

create table chronoflow_node_biz_history ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, dag_id bigint unsigned null, node_id bigint unsigned null, node_name varchar(128) null, namespace varchar(64) null, field varchar(128) null, label varchar(255) null, value text null, mark text null, option text null ) charset = utf8mb4;

create index create_time on chronoflow_node_biz_history (created_at);

create index update_time on chronoflow_node_biz_history (updated_at);

create table chronoflow_node_define ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, dag_def_id bigint unsigned null, namespace varchar(64) null, node_name varchar(128) null, node_type varchar(64) null, service_name varchar(128) null, display_name varchar(255) null, query_conf varchar(255) null, retry_conf bigint null, node_param text null, link_param text null ) charset = utf8mb4;

create index create_time on chronoflow_node_define (created_at);

create index idx_namespace on chronoflow_node_define (namespace);

create index idx_node_name on chronoflow_node_define (node_name);

create index idx_service_name on chronoflow_node_define (service_name);

create index update_time on chronoflow_node_define (updated_at);

create table chronoflow_node_history ( id bigint unsigned auto_increment primary key, created_at datetime(3) null, updated_at datetime(3) null, tenant_uin varchar(128) null, created_by varchar(128) null, updated_by varchar(128) null, dag_def_id bigint unsigned null, namespace varchar(64) null, dag_id bigint unsigned null, node_name varchar(128) null, node_type varchar(64) null, service_name varchar(128) null, display_name varchar(255) null, input text null, output text null, biz text null, query_conf varchar(255) null, retry_conf bigint null, stage varchar(64) null, status varchar(64) null, result varchar(64) null, log text null, current tinyint(1) null, expire_time bigint null, query bigint null, retry bigint null, version bigint null, link_param text null, start_time datetime(3) null, finish_time datetime(3) null ) charset = utf8mb4;

create index create_time on chronoflow_node_history (created_at);

create index update_time on chronoflow_node_history (updated_at);

create table clb ( clb_id int auto_increment comment 'CLB自增ID' primary key, load_balancer_id varchar(255) not null comment '负载均衡实例 ID', load_balancer_name varchar(255) not null comment '负载均衡实例的名称', maintainer varchar(255) null comment '负责人', load_balancer_type varchar(255) not null comment '负载均衡实例的网络类型:Public:公网属性, Private:内网属性。', domain varchar(255) null comment '转发规则的域名。', status int not null comment '负载均衡实例的状态,包括 0:创建中,1:正常运行。', vip varchar(255) null comment '负载均衡实例的 VIP', vpc_id varchar(255) null comment '负载均衡实例所属私有网络的 ID', tags json null comment '负载均衡实例的标签信息 []{"TagKey":"","TagValue":""}', project_id varchar(255) null comment '负载均衡实例所属的项目 ID, 0 表示默认项目', project_name varchar(255) null comment '负载均衡实例所属的项目名称', account_id varchar(255) null comment '属于哪个主账号', app_id varchar(255) null comment '属于哪个应用', zone_id int null comment '可用区数值形式的唯一ID', zone varchar(255) null comment '可用区字符串形式的唯一ID', zone_name varchar(255) null comment '可用区名称', region_name varchar(255) null comment '可用区所属地域', create_time datetime default CURRENT_TIMESTAMP null comment '新增时间', creator varchar(64) null comment '创建者', custom_extensions json null comment '客户自定义字段预留字段', update_time datetime null comment '修改时间', clb_create_time varchar(256) null comment 'clb创建时间', destroyed int default 0 null comment '是否被清理' ) comment '负载均衡CLB表';

create table cloud ( cloud_id int auto_increment comment '云区域ID' primary key, cloud_name varchar(64) not null comment '云区域名称', create_time datetime default CURRENT_TIMESTAMP not null comment '新增时间', update_time datetime null comment '更新时间', preset tinyint(1) null comment '是否预设数据', creator varchar(64) null comment '创建者', custom_extensions json null comment '客户自定义字段预留列', modify_time datetime default CURRENT_TIMESTAMP null comment '更新时间', base_info json null comment '基础信息', cloud_plan_id varchar(256) null comment '云区域规划ID', title varchar(256) null comment '云标题', title_zh_cn varchar(256) null comment '云标题中文名(国际化)', title_en_us varchar(256) null comment '云标题英文名(国际化)', domain_root varchar(256) null comment '根域名', domain_main varchar(256) null comment '主域名', domain_cos varchar(256) null comment 'cos域名', lang_set json null comment '支持的语言列表', constraint cloud_cloud_name_uindex unique (cloud_name) ) comment '云区域表';

create table cmdb_sync_config ( sync_config_id int auto_increment comment '同步任务的唯一ID' primary key, source_type int not null comment '同步的类型 1:公有云 2:专有云', import_from varchar(255) null comment '数据来源', bk_cloud_id int not null comment '云平台', bk_cloud_name varchar(255) not null comment '云平台名称', object_type varchar(255) not null comment '对象类型 host -- 主机', region varchar(255) null comment '地域以逗号分隔。 如:chongqing,shanghai', request_element text null comment 'json格式的数据,比如: API秘钥 SecreID API密钥 SecretKey 查询地域信息的url', sync_cycle int not null comment '同步周期(以分钟为单位)', delete_strategy int not null comment '来源数据被删除时,本端数据删除处理策略: 1、立即彻底删除 2、暂缓删除 3、不删除', conflict_strategy int not null comment '来源数据与本端数据冲突处理策略 1、覆盖本端数据 2、不覆盖数据 3、手工操作', delete_strategy_delay_time int null comment '暂缓删除,数据保留的天数', begin_time datetime null comment '同步任务开始的时间', end_time datetime null comment '同步任务结束的时间', sync_status int null comment '同步结果 1:成功 2:失败 3:数据冲突 4:同步中', is_preset tinyint(1) default 0 null comment '是否为预设数据(预设数据不能删) 0:不是 1:是', bk_cloud_name_Chinese varchar(255) null comment '云平台名称(中文)', sync_element_id int not null comment '同步元素ID', error_message longtext null comment '错误信息', compare_message longtext null comment '同步对比信息' ) comment '同步配置表';

create table cmdb_sync_conflict ( conflict_id int auto_increment comment '冲突项的唯一ID' primary key, history_id int not null comment '同步历史记录的唯一ID', object_type varchar(255) not null comment '同步对象类型', is_fixed int not null comment '标志是否已经处理: 未处理:0 已覆盖:1 已忽略:2', add_time datetime not null comment '录入时间', detail text not null comment '该冲突项的数据详情(json格式)' ) comment '同步冲突表';

create table cmdb_sync_element ( element_id int auto_increment primary key, source_type int not null comment '同步的类型 1:公有云 2:专有云', import_from varchar(255) null comment '数据来源。当同步类型是专有云时,必填', bk_cloud_id int null comment '云平台。当同步类型是公有云时,必填', bk_cloud_name varchar(255) null comment '云平台名称。当同步类型是公有云时,必填', object_type varchar(255) not null comment '对象类型:host -- 主机', request_element text null comment 'json格式的数据', bk_cloud_name_Chinese varchar(255) null comment '云平台名称。当同步类型是公有云时,必填' ) comment '同步元素表';

create table cmdb_sync_history ( history_id int auto_increment comment '同步历史记录的唯一ID' primary key, sync_config_id int not null comment '同步任务的唯一ID', source_type int not null comment '同步的类型 1:公有云 2:专有云', object_type varchar(255) not null comment '对象类型 host -- 主机', bk_cloud_id int not null comment '云平台ID', bk_cloud_name varchar(255) not null comment '云平台名称', region varchar(255) not null comment '地域以逗号分隔。如:chongqing,shanghai', begin_time datetime null comment '同步任务开始的时间', end_time datetime null comment '同步任务结束的时间', sync_status int null comment '同步结果 1:成功 2:失败 3:数据冲突 4:同步中', operator varchar(255) not null comment '操作人', is_newest tinyint(1) not null comment '是否可以编辑 0:不可以 1:可以', import_from varchar(255) null comment '数据来源', bk_cloud_name_Chinese varchar(255) null comment '云平台名称(中文)', error_message text null comment '错误信息', compare_message text null comment '同步对比信息', account_id varchar(64) null comment '租户账号ID' ) comment '同步历史表';

create table env_info ( id int auto_increment primary key, uuid varchar(512) not null comment '环境UUID', account_id varchar(64) not null comment '租户ID', name varchar(256) not null comment '环境名称', env_code varchar(256) not null comment '环境英文名', usage varchar(64) not null comment '环境用途', description varchar(256) null comment '环境描述', manager varchar(256) not null comment '环境负责人', creator varchar(32) null comment '创建者', created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间', modifier varchar(32) null comment '修改人', updated_at datetime default CURRENT_TIMESTAMP not null comment '修改时间', deleted_at datetime null comment '修改时间', preset tinyint(1) default 0 null comment '是否为预设数据 0:否 1:是' ) comment '租户端环境信息表';

create table env_node_rel ( id int auto_increment primary key, env_uuid varchar(512) not null comment '环境唯一标识', node_uuid varchar(512) not null comment '节点唯一标识', env_code varchar(256) not null comment '环境英文名,冗余字段', manager varchar(256) not null comment '环境节点负责人', maintainer varchar(256) null comment '环境节点运维人员', creator varchar(32) not null comment '创建者', created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间', modifier varchar(32) not null comment '修改人', updated_at datetime default CURRENT_TIMESTAMP not null comment '修改时间', deleted_at datetime null comment '修改时间', preset tinyint(1) default 0 null comment '是否为预设数据 0:否 1:是' ) comment '节点关联环境表';

create table env_resource_rel ( id int auto_increment comment '唯一标识ID' primary key, env_uuid varchar(512) not null comment '环境UUID', inst_model_uuid varchar(128) not null comment '实例模型UUID', inst_id int not null comment '实例ID', creator varchar(32) null comment '创建者', created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间' ) comment '环境关联资源表';

create table environment_lock ( id bigint unsigned auto_increment, node_uuid varchar(512) not null comment '业务节点uuid', env_uuid varchar(512) not null comment '环境uuid', lock_status tinyint(1) not null comment '锁状态', lock_holder varchar(128) not null comment '锁持有者', created_at datetime null comment '创建时间', updated_at datetime null comment '更新时间', primary key (node_uuid, env_uuid), constraint id unique (id) ) comment '环境锁表';

create table event ( event_id int auto_increment comment 'id' primary key, event_name varchar(255) null comment '事件名称', operate_type varchar(255) null comment '操作类型', event_describe text null comment '事件描述', event_model varchar(255) null comment '事件所属模型', event_model_cn varchar(255) null comment '事件所属模型中文名', event_module varchar(255) null comment '事件所属模块', event_template text null comment ' 事件模板', create_time datetime null comment '创建时间', creator varchar(255) null comment '创建者', maintainer varchar(255) null comment '运维人员', preset tinyint(1) null comment '是否预置' ) comment '回调事件表';

create table flyway_schema_history ( installed_rank int not null primary key, version varchar(50) null, description varchar(200) not null, type varchar(20) not null, script varchar(1000) not null, checksum int null, installed_by varchar(100) not null, installed_on timestamp default CURRENT_TIMESTAMP not null, execution_time int not null, success tinyint(1) not null );

create index flyway_schema_history_s_idx on flyway_schema_history (success);

create table full_text_data ( id int auto_increment primary key, model_uuid varchar(256) null comment '模型', inst_id int null comment '数据ID', inst_data json null, inst_data_extra longtext collate utf8_bin null, account_id varchar(64) null comment '租户账号ID' ) comment '全文检索缓存表';

create index InstIdIndex on full_text_data (inst_id);

create index ModelUuidIndex on full_text_data (model_uuid);

create table host ( host_id int auto_increment comment '主机ID' primary key, asset_id varchar(128) not null comment '固资编号', host_name varchar(256) null comment '主机名称', rack_name varchar(64) null comment '机架名', switch varchar(255) null comment '上联网关信息', zone_name varchar(64) null comment '可用区名称', master_agent_info json null comment '主控agent信息', os_name varchar(128) null comment '操作系统名称', os_type varchar(64) null comment '操作系统类型', maintainer varchar(255) null comment '负责人', inner_ip varchar(256) null comment '内网IP', vm_status varchar(64) null comment '虚拟机状态', host_ip char(16) null comment '母机IP', host_type varchar(32) not null comment '主机类型', master_agent_status varchar(32) null comment '主控agent状态', region_name varchar(32) null comment '地域名称', producer varchar(64) null comment '厂家', disk varchar(255) null comment '硬盘信息', outer_ip varchar(256) null comment '硬盘', rack_pos_id int null comment '机位', device_description text null comment '设备描述', device_type varchar(128) null comment '机型', logic_area varchar(128) null comment '逻辑区域(对应机架机位所在的网络区域)', create_time datetime default CURRENT_TIMESTAMP not null comment '新增时间', update_time datetime null comment '更新时间', collect_agent_info json null comment '采控agent信息', cpu_module varchar(255) null comment 'cpu型号', host_status varchar(32) null comment '主机状态', idc_name varchar(64) null comment 'IDC名称', import_from varchar(32) null comment '数据来源', device_height varchar(32) null comment '设备高度', lan_mask char(16) null comment '内网掩码', wan_mask char(16) null comment '外网掩码', sn varchar(64) null comment 'sn', wan_gateway char(16) null comment '外网网关', cloud_id int default 1 not null comment '云区域ID', idc_id int null comment '机房ID', outer_mac varchar(32) null comment '外网MAC', inner_mac varchar(32) null comment '内网MAC', raid_type varchar(64) null comment 'RAID类型', mem varchar(255) null comment '内存信息', labels json null comment '标签', kernel varchar(255) null comment '内核信息', apply_user varchar(64) null comment '申领者', source varchar(64) null comment '申领来源', apply_time datetime null comment '申领时间', host_hardware_property_alarm tinyint(1) default 0 null comment '主机硬件属性校验告警', cpu_architecture varchar(64) null comment 'CPU架构', account_id varchar(64) default '-1' null comment '租户账号ID', custom_extensions json null comment '客户自定义字段预留列', modify_time datetime default CURRENT_TIMESTAMP null comment '更新时间', total_mem varchar(64) null comment '总内存', cpu_core_num varchar(256) null comment 'CPU核数', region_id int null comment '地域ID', zone_id int null comment '可用区ID', sys_cpu_architecture varchar(256) null comment '系统CPU架构', inner_gateway varchar(256) null comment '内联网关', outer_switch varchar(256) null comment '外联网关', manage_ip varchar(256) null comment '管理网IP', manage_mask varchar(256) null comment '管理网掩码', manage_gateway varchar(256) null comment '管理网网关', manage_mac varchar(256) null comment '管理网MAC', manage_switch varchar(256) null comment '管理网上联信息', is_double_bonding int null comment '双bonding标识', svr_virtual_lan_ip varchar(255) null comment '虚拟内网ip', svr_virtual_wan_ip varchar(255) null comment '虚拟外网ip', svr_vm_index int null comment '虚拟机最大index', cluster_id varchar(256) null comment '集群ID', dcos_host_status varchar(256) null comment 'DCOS机器状态', vm_type varchar(255) null comment '虚拟机类型', host_asset_id varchar(256) null comment '宿主机固资编号', total_disk varchar(255) null comment '硬盘总大小', vpc_id int null comment 'VPC ID', project_name varchar(256) null comment '所属项目', app_id varchar(64) null comment '租户账号APP ID', project_id varchar(64) null comment '所属项目ID', instance_id varchar(64) null comment '实例ID', destroyed int default 0 null comment '是否被清理', constraint host_asset_id_uindex unique (asset_id), constraint host_instance_id_uindex unique (instance_id), constraint host_sn_uindex unique (sn) ) comment '主机表';

create table id_generator ( model_uuid varchar(64) not null comment '自定义模型的uuid' primary key, sequence_id int default 0 not null comment '该模型的最新id(新增该模型的对象时在此id基础上加1)', constraint id_generator_model_uuid_uindex unique (model_uuid) ) comment 'ID生成参照表';

create table idc ( idc_id int auto_increment comment 'idc ID,使用自增 ID 作为唯一标识' primary key, idc_name varchar(255) not null comment 'idc 英文名称', cn_idc_name varchar(255) not null comment 'idc 中文名称', create_time datetime not null comment '创建时间', update_time datetime not null comment '更新时间', custom_extensions json null comment '客户自定义字段预留列', idc_en_us varchar(64) null comment '机房英文名称', idc_no int null comment '机房编号', zone_id int null comment '可用区ID' ) comment '机房资源';

create table instance ( id int auto_increment primary key, model_uuid varchar(64) not null comment '模型ID', content json null comment '实例内容' ) comment '自定义模型实例';

create table model_field_display_mode ( id int auto_increment primary key, uuid varchar(64) not null comment '模型字段显示配置UUID', user_id varchar(64) not null comment '用户', model_uuid varchar(64) not null comment '模型UUID(比如:biz、set、module)', field_mode text not null comment '字段显示模式', update_time datetime null comment '更新时间', master_model varchar(64) default '' not null comment '附属的主模型 UUID' ) comment '模型字段显示配置表';

create table model_group ( model_group_uuid varchar(64) not null comment '模型分组英文ID' primary key, model_group_name varchar(64) not null comment '模型分组名称', model_group_name_en varchar(64) null comment '模型分组的英文名称。(预设数据才有英文版,客户自定义数据本列为空)', model_group_icon varchar(32) null comment '模型分组图标', preset tinyint(1) default 0 null comment '是否预设数据', model_group_index int default 10000 not null comment '模型分组排序', account_id varchar(32) default '' not null, constraint model_group_model_group_id_uindex unique (model_group_uuid), constraint model_group_model_group_name_uindex unique (model_group_name) ) comment '模型分组表';

create table model ( model_uuid varchar(64) not null comment '实例对象英文ID' primary key, model_name varchar(32) not null comment '实例对象名称', model_name_en varchar(32) null comment '实例对象名称英文版(只有预设数据有英文版名称,客户自定义数据本列为空)', model_icon varchar(32) null comment '实例对象图例', create_time datetime default CURRENT_TIMESTAMP not null comment '新增时间', preset tinyint(1) default 0 null comment '是否为预设数据', modify_time datetime null comment '修改时间', description varchar(128) null comment '描述', model_group_uuid varchar(64) not null comment '模型分组ID', creator varchar(32) null comment '创建者', modifier varchar(32) null comment '修改者', model_index int default 10000 not null comment '模型排序', used tinyint(1) default 1 null comment '是否启用', account_id varchar(32) default '' not null, constraint model_model_id_uindex unique (model_uuid), constraint model_model_group_model_group_id_fk foreign key (model_group_uuid) references model_group (model_group_uuid) ) comment '模型表';

create table model_stats ( id int auto_increment primary key, total int not null comment '所有模型包含的实例数量,日统计', update_count int not null comment '当日实例变更次数,日统计', create_time datetime null comment '创建时间', update_time datetime null comment '更新时间' ) comment '模型统计信息表,由定时任务插入数据';

create table node ( node_id int auto_increment comment '节点自增ID' primary key, node_uuid varchar(512) not null comment '节点唯一标识', node_name varchar(256) null comment '节点名称', maintainer text null comment '运维人员', preset tinyint(1) null comment '是否预设', default tinyint(1) null comment '是否资源池', update_time datetime null comment '更新时间', create_time datetime null comment '创建时间', display tinyint(1) null comment '是否展示', is_cloud_product tinyint(1) null comment '是否独立云产品', node_type varchar(64) null comment '节点类型', relation_model text null comment '关联模型', desc text null comment '描述', version varchar(256) null comment '版本', parent_uuid varchar(512) null comment '父节点UUID', front_node_uuid_list text null comment '前置节点UUID', tree_level int null comment '业务树层级', tree_leaf tinyint(1) null comment '是否叶子节点', custom_extensions json null comment '客制化字段', creator varchar(128) null comment '创建者', import_from varchar(128) null comment '数据来源', account_id varchar(64) null comment '租户账号ID', manager varchar(128) null comment '负责人', deploy_method varchar(128) null comment '部署方式', language varchar(128) null comment '语言', node_name_en varchar(256) null comment '节点英文名称', constraint node_node_uuid_uindex unique (node_uuid) ) comment '业务树节点';

create index idx_parent_uuid on node (parent_uuid);

create table node_topo ( id int auto_increment primary key, account_id varchar(64) not null comment '租户ID', name varchar(64) not null comment '拓扑名称', level int not null comment '拓扑层数', topo json not null comment '拓扑结构', description varchar(255) null comment '拓扑描述', preset tinyint(1) default 0 null comment '是否预设', creator varchar(32) null comment '创建者', created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间', modifier varchar(32) null comment '修改人', updated_at datetime default CURRENT_TIMESTAMP not null comment '修改时间', deleted_at datetime null comment '修改时间' ) comment '业务树拓扑模型表';

create table node_workload_rel ( id int auto_increment comment '唯一标识ID' primary key, tke_id int not null comment 'tke的id', env_node_id int not null comment '组件实例ID', cluster_instance_id varchar(255) not null comment 'tke集群实例ID', namespace varchar(64) not null comment '实例ID', workload_name varchar(256) not null comment '工作负载名称', workload_type varchar(64) not null comment '工作负载类型', creator varchar(32) null comment '创建者', created_at datetime default CURRENT_TIMESTAMP not null comment '创建时间', constraint uk_workload unique (cluster_instance_id, namespace, workload_type, workload_name) ) comment '组件关联工作负载表';

create table operation_log ( id int auto_increment primary key, model_uuid varchar(64) not null comment '操作对象模型uuid', operate_type varchar(64) not null comment '操作类型:create - 增; delete - 删; update - 改; host_module_transfer - 主机关系转移', operator varchar(32) not null comment '操作者', operate_time datetime default CURRENT_TIMESTAMP not null comment '操作时间', inst_id int not null comment '实例ID', compare json null comment '前后数据对比', ext_key varchar(64) null comment '备用的key', description text null comment '描述', account_id varchar(64) null comment '租户账号ID' ) comment '审计日志';

create index idx_inst_id on operation_log (inst_id);

create index idx_model_uuid on operation_log (model_uuid);

create index idx_operate_time on operation_log (operate_time);

create table property ( id int auto_increment primary key, property_name varchar(32) null comment '属性名称', property_name_en varchar(32) null comment '属性的英文名称。(只有预设的数据有专属的英文名,客户自定义的,本列数据同property_name)', model_uuid varchar(64) not null comment '所属模型UUID', create_parameter tinyint(1) default 1 not null comment '是否为新增实例时可传的参数', property_code varchar(32) not null comment '属性英文ID', is_required tinyint(1) default 0 not null comment '是否必填', is_only tinyint(1) default 0 not null comment '是否唯一', property_type varchar(32) not null comment '属性类型', option json null comment '枚举可选值', description varchar(255) null comment '提示语', creator varchar(32) null comment '创建者', group_id int null comment '所属分组ID', editable tinyint(1) default 1 not null comment '是否可编辑', create_time datetime default CURRENT_TIMESTAMP not null comment '新增时间', modify_time datetime default CURRENT_TIMESTAMP not null comment '更新时间', property_index int default 0 not null comment '属性排序', preset tinyint(1) default 0 null comment '是否预设数据', is_default tinyint(1) default 1 not null comment '是不是默认的字段', default_display tinyint(1) default 1 not null comment '是否默认展示', belong varchar(128) null comment '所属节点类型', account_id varchar(32) default '' not null ) comment '字段表';

create table property_group ( id int auto_increment primary key, property_group_name varchar(64) not null comment '字段分组名称', property_group_name_en varchar(64) null comment '字段分组名称英文版(只有初始化数据有英文版,客户自定义数据此列为空)', model_uuid varchar(64) null comment '字段分组所属模型', property_group_index int default 0 null comment '分组索引', property_group_code varchar(32) not null comment '字段分组ID', is_default tinyint(1) default 1 not null comment '是否为默认分组', preset tinyint(1) default 0 null comment '是否为预设数据', account_id varchar(32) default '' not null ) comment '字段分组信息表';

create table redis ( redis_id bigint unsigned auto_increment primary key, instance_name varchar(255) null comment '实例名称', instance_id varchar(255) null comment '实例Id', appid int null comment '用户的Appid', project_id int null comment '创建时间', region_name varchar(255) null comment '地域', zone_name varchar(255) null comment '区域', region_id int null comment '地域', zone_id int null comment '区域id', vpc_id int null comment 'vpc网络id', subnet_id int null comment 'vpc网络下子网id', status int null comment '实例当前状态,0:待初始化;1:实例在流程中;2:实例运行中;', wan_ip varchar(255) null comment '实例vip', port int null comment '实例端口号', createtime varchar(255) null comment '实例创建时间', size int null comment '实例容量大小,单位:MB', type int null comment '实例类型', auto_renew_flag int null comment '实例是否设置自动续费标识', deadline_time varchar(255) null comment '实例到期时间', engine varchar(255) null comment '引擎', product_type varchar(255) null comment ' 产品类型', uniq_vpc_id varchar(255) null comment 'vpc网络id', uniq_subnet_id varchar(255) null comment 'vpc网络下子网id', billing_mode int null comment ' 计费模式', instance_title varchar(255) null comment '实例运行状态描述', offline_time varchar(255) null comment '计划下线时间', sub_status int null comment '流程中的实例,返回子状态', tags json null comment '反亲和性标签', instance_node json null comment '实例节点信息', redis_shard_size int null comment '分片大小', redis_shard_num int null comment '分片数量', redis_replicas_num int null comment '副本数量', price_id int null comment '计费Id', close_time varchar(255) null comment '隔离时间', slave_read_weight int null comment '从节点读取权重', instance_tags json null comment '实例关联的标签信息', project_name varchar(255) null comment '项目名称', node_set json null comment '节点信息', read_only int null comment '只读', resource_pool varchar(255) null comment '资源池id', arch varchar(255) null comment '机器cpu架构', region varchar(255) null comment '地域', monitor_version varchar(255) null comment '监控级别', disk_replicas_num int null comment '磁盘副本', disk_shard_size int null comment '磁盘大小', disk_shard_num int null comment '分片数', application_version varchar(255) null comment '实例版本', net_limit int null comment '网络限制', client_limit int null comment '客户端限制', platform_project_id varchar(255) null comment '项目id', platform_project_name varchar(255) null comment '项目名称', dts_status int null comment 'dts状态', password_free int null comment '是否免密', disk_size int null comment '磁盘大小', no_auth tinyint(1) null comment '是否鉴权', vip6 varchar(255) null comment 'Vip6地址', client_limit_min int null comment '客户端下限', client_limit_max int null comment '客户端上限', remain_bandwidth_duration varchar(255) null comment '带宽Duration', create_time datetime null comment '创建时间', creator varchar(255) null comment '创建者', custom_extensions json null comment '客户自定义字段预留列', destroyed int default 0 null comment '是否被清理', maintainer varchar(255) null comment '负责人', account_id varchar(255) null comment '租户' );

create table region ( region_id int auto_increment comment 'region ID,使用自增 ID 作为唯一标识' primary key, region_name varchar(255) not null comment 'region 英文名称', cn_region_name varchar(255) not null comment 'region 中文名称', role varchar(32) not null comment 'region 角色', create_time datetime not null comment '创建时间', update_time datetime not null comment '更新时间', custom_extensions json null comment '客户自定义字段预留列', region_area varchar(64) null comment '所属区域', region_area_en_us varchar(64) null comment '所属区域英文名', region_area_zh_cn varchar(64) null comment '所属区域中文名', region_city varchar(64) null comment '所属城市', region_name_long varchar(64) null comment '地域长名', region_no int null comment '地域编号' ) comment '地域资源';

create table resource_tag ( id int auto_increment primary key, tag_id int not null comment '标签ID', resource_id varchar(255) not null comment '资源实例ID', resource_type varchar(255) not null comment '资源类型' ) comment '标签资源关联表';

create index resourceIdIndex on resource_tag (resource_id);

create index resourceTypeIndex on resource_tag (resource_type);

create index resourceTypeResourceIdIndex on resource_tag (resource_type, resource_id);

create index tagIdIndex on resource_tag (tag_id);

create table role ( role_id bigint unsigned auto_increment primary key, role_code varchar(128) null, role_key varchar(128) null, role_name varchar(128) null, role_description text null, used_operate_list json null, operate_list json null, auth_by_instance tinyint(1) null, approver varchar(128) null, operator varchar(128) null, create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', account_id varchar(128) null, constraint role_code unique (role_code, account_id) );

create table role_object ( object_id bigint unsigned auto_increment primary key, object_code varchar(128) null, object_name varchar(128) null, service_id bigint null, service_code varchar(128) null, auth_resource_list json null, register_resource_list json null, operator varchar(128) null, create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', account_id varchar(128) null, constraint object_code unique (object_code, account_id, service_code) );

create table role_operate ( operate_id bigint unsigned auto_increment primary key, operate_code varchar(128) null, operate_name varchar(128) null, resource_type_id bigint null, operator varchar(128) null, type varchar(128) null, create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', account_id varchar(128) null, constraint operate_code unique (operate_code, account_id) );

create table role_resource_type ( resource_type_id bigint unsigned auto_increment primary key, resource_type_code varchar(128) null, resource_type_name varchar(128) null, approver varchar(128) null, operator varchar(128) null, create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', account_id varchar(128) null, constraint resource_type_code unique (resource_type_code, account_id) );

create table role_service ( service_id bigint unsigned auto_increment primary key, service_code varchar(128) null, service_name varchar(128) null, desc text null, create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', account_id varchar(128) null, constraint service_code unique (service_code, account_id) );

create table role_user ( role_code varchar(128) not null, user_Id varchar(128) not null, operator varchar(128) null, create_time datetime default CURRENT_TIMESTAMP null comment '创建时间', account_id varchar(128) null );

create table role_user_resource ( user_Id varchar(128) not null, resource_type_code varchar(128) not null, instance_id varchar(128) not null, operator varchar(128) null, create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间', account_id varchar(128) not null );

create table subscription ( subscription_id int auto_increment comment 'id' primary key, subscription_name varchar(255) null comment '订阅名称', subscription_describe text null comment '订阅描述', callback_url varchar(255) null comment '回调 url', subscription_template text null comment '回调信息模板', event_list json null comment '订阅事件列表', event_id_list json null comment '订阅事件ID列表', create_time datetime null comment '创建时间', creator varchar(255) null comment '创建者', update_time datetime null comment '修改时间', modifier varchar(255) null comment '修改人', preset tinyint(1) null comment '是否预置', maintainer varchar(255) null comment '运维人员', account_id varchar(255) null comment '属于哪个主账号' ) comment '回调订阅表';

create table subscription_log ( subscription_log_id int auto_increment comment '自增 id' primary key, subscription_id int null comment '订阅id', subscription_name varchar(255) null comment '订阅名称', status varchar(64) null comment '状态', retry_num int null comment '重试次数', callback_url varchar(255) null comment '回调 url', error_code text null comment '失败 code', request text null comment '回调请求', response text null comment '回调返回', create_time datetime null comment '创建时间', maintainer varchar(255) null comment '运维人员', account_id varchar(255) null comment '属于哪个主账号' ) comment '回调订阅历史表';

create table tag ( tag_id int auto_increment primary key, tag_key varchar(255) not null comment '标签Key', tag_value text null comment '标签值', tag_type int not null comment '标签类型', can_delete int default 1 not null comment '是否可以删除', field varchar(255) null comment '对应字段', account_id varchar(64) null comment '租户账号ID' ) comment '标签表';

create index tag_key on tag (tag_key);

create table tdsql_mysql ( tdsql_mysql_id int auto_increment comment 'id' primary key, instance_id varchar(255) null comment '实例ID', instance_name varchar(255) null comment '实例名称', project_id varchar(255) null comment '项目ID', maintainer varchar(255) null comment '负责人', project_name varchar(255) null comment '项目名称', region_name varchar(255) null comment '地域', zone_name varchar(255) null comment '可用区', status int null comment '实例状态', vip varchar(255) null comment '内网IP', v_port int null comment '内网端口', memory int null comment '内存大小,单位 GB', storage int null comment '存储大小,单位 GB', node_count int null comment '节点数', db_engine varchar(255) null comment '数据库引擎', db_version varchar(255) null comment '数据库引擎版本', instance_type int null comment '实例类型', create_time datetime null comment '创建时间', update_time datetime null comment '更新时间', tdsql_create_time varchar(255) null comment 'tdsql创建时间', creator varchar(255) null comment '创建者', custom_extensions varchar(255) null comment '客户自定义字段预留字段', account_id varchar(255) null comment '属于哪个主账号', app_id varchar(255) null comment '属于哪个应用', destroyed int default 0 null comment '是否被清理' ) comment 'TDSQL_MySQL版';

create table tke ( tke_id int auto_increment comment 'id' primary key, cluster_instance_id varchar(255) null comment '集群ID', cluster_name varchar(255) null comment '集群名称', maintainer varchar(255) null comment '负责人', status varchar(255) null comment '集群状态', k8s_version varchar(255) null comment 'K8S 版本', total_instance int null comment '节点数', region_name varchar(255) null comment '地域', zone_name varchar(255) null comment '可用区', is_cluster_deploy int null comment '实例类型', create_time datetime null comment '创建时间', creator varchar(255) null comment '创建者', custom_extensions varchar(255) null comment '客户自定义字段预留字段', account_id varchar(255) null comment '属于哪个主账号', app_id varchar(255) null comment '属于哪个应用', destroyed int default 0 null comment '是否被清理' ) comment '集群基础信息';

create table unique_verification ( id int auto_increment comment '唯一标识ID' primary key, account_id varchar(32) not null comment '租户信息', model_uuid varchar(64) not null comment '模型UUID', type int not null comment '校验规则', propertys text not null comment '校验字段' ) comment '唯一性校验表';

create table vpc ( vpc_id int not null comment 'id' primary key, uniq_vpc_id varchar(255) null comment '实例ID', vpc_name varchar(255) null comment '名称', maintainer varchar(255) null comment '负责人', enable_multicast varchar(64) null comment '组播', cidr_block varchar(64) null comment 'IPv4 CIDR ', ipv6cidr_block varchar(64) null comment 'IPv6 CIDR', subnet_num int null comment '子网数目', rtb_num int null comment '路由表数目', vpg_num int null comment '专线网关数目', vm_num int null comment '子机数目', vpc_peer_num int null comment '对等连接数目', nat_num int null comment 'NAT网关数目', acl_num int null comment 'ACL 数目', vpngw_num int null comment 'vpn网关数目', create_time datetime null comment '创建时间', vpc_create_time varchar(255) null comment 'VPC创建时间', custom_extensions varchar(255) null comment '客户自定义字段预留字段', account_id varchar(255) null comment '属于哪个主账号', app_id varchar(255) null comment '属于哪个应用', destroyed int default 0 null comment '是否被清理' ) comment 'VPC私有网络信息';

create table zone ( zone_id int auto_increment comment 'zone ID,使用自增 ID 作为唯一标识' primary key, zone_name varchar(255) not null comment 'zone 英文名称', cn_zone_name varchar(255) not null comment 'zone 中文名称', role varchar(32) not null comment 'zone 角色', create_time datetime not null comment '创建时间', update_time datetime not null comment '更新时间', custom_extensions json null comment '客户自定义字段预留列', zone_name_en_us varchar(64) null comment '可用区英文名', zone_no int null comment '可用区编号', region_id int null comment '地域ID', vpc_vip json null comment 'vpc ip list' ) comment '可用区资源';

主机运维

主机运维数据表汇总

对应模块 所属数据库名 表名 功能说明
worktool
worktool_platform
system_config 系统配置
rule 黑名单规则
script 脚本
task 任务
task_node 任务节点
cron_task 定时任务
tag TAG
tag_resource_relation TAG 与资源关系
workflow-v2 workflow_eninge v2_instance 实例
v2_instance_event 实例事件
v2_instance_node 实例节点
v2_instance_var 实例变量
v2_template 模板
v2_template_cron 定时模板
v2_template_node 模板节点
v2_template_var 模板变量
remote-executor remote_executor blacklist 黑名单命令
leader_election 服务选举
task 任务
subtask 子任务
agent-server agent-server agent Agent
node 节点
command 命令
instruction 指令

主机运维表详情

worktool_platform数据库

CREATE TABLE cron_task ( ** id int NOT NULL AUTO_INCREMENT,** ** name varchar(256) DEFAULT NULL,** ** description text,** ** script_id int DEFAULT NULL,** ** cron varchar(255) DEFAULT NULL,** ** args text CHARACTER SET utf8 COLLATE utf8_general_ci,** ** user varchar(255) DEFAULT NULL,** ** time_limit int DEFAULT NULL,** ** host_list json DEFAULT NULL,** ** creator varchar(255) DEFAULT NULL,** ** modifier varchar(255) DEFAULT NULL,** ** account_id varchar(255) DEFAULT NULL,** ** template_uuid varchar(255) DEFAULT NULL,** ** last_exec_task_id int DEFAULT NULL,** ** count int DEFAULT NULL,** ** status varchar(255) DEFAULT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** is_roll tinyint DEFAULT NULL,** ** concurrent int DEFAULT NULL,** ** task_type varchar(255) DEFAULT NULL,** ** ansible_ip varchar(255) DEFAULT NULL,** ** ansible_sn varchar(255) DEFAULT NULL,** ** ansible_type varchar(255) DEFAULT NULL,** ** ansible_command text,** ** last_exec_time datetime DEFAULT NULL,** ** ansible_playbook_name varchar(255) DEFAULT NULL,** ** script_name varchar(256) DEFAULT NULL,** ** is_cron_str_basic tinyint DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** owner json DEFAULT NULL,** ** last_exec_status varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY script_id_index (script_id),** ** KEY creator_index (creator),** ** KEY modifier_index (modifier),** ** KEY created_at_index (created_at),** ** KEY updated_at_index (updated_at),** ** KEY account_id_index (account_id),** ** KEY template_uuid_index (template_uuid),** ** KEY last_exec_task_id_index (last_exec_task_id),** ** KEY status_index (status),** ** KEY task_type_index (task_type) USING BTREE,** ** KEY uin_index (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb3;

CREATE TABLE rule ( ** id int NOT NULL AUTO_INCREMENT,** ** name varchar(128) DEFAULT NULL,** ** rule varchar(256) DEFAULT NULL,** ** type varchar(128) DEFAULT NULL,** ** creator varchar(128) DEFAULT NULL,** ** modifier varchar(128) DEFAULT NULL,** ** preset tinyint DEFAULT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** open tinyint DEFAULT NULL,** ** account_id varchar(128) DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** owner json DEFAULT NULL,** ** controller json DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY typeindex (type),** ** KEY presetindex (preset),** ** KEY creatorindex (creator),** ** KEY modifierindex (modifier),** ** KEY createdindex (created_at),** ** KEY updatedindex (updated_at),** ** KEY deletedindex (deleted_at),** ** KEY uinindex (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=1055 DEFAULT CHARSET=utf8mb3;

CREATE TABLE script ( ** id int NOT NULL AUTO_INCREMENT,** ** name varchar(256) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,** ** type varchar(128) NOT NULL,** ** content longtext NOT NULL,** ** host_list json DEFAULT NULL,** ** description text,** ** creator varchar(128) NOT NULL,** ** modifier varchar(128) NOT NULL,** ** version varchar(128) NOT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** account_id varchar(128) DEFAULT NULL,** ** preset tinyint DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** owner json DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY typeindex (type),** ** KEY creatorindex (creator),** ** KEY modifierindex (modifier),** ** KEY versionindex (version),** ** KEY createdindex (created_at),** ** KEY updated_at (updated_at),** ** KEY deleted_at (deleted_at),** ** KEY presetindex (preset) USING BTREE,** ** KEY uinindex (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=1000016 DEFAULT CHARSET=utf8mb3;

CREATE TABLE system_config ( ** id int NOT NULL AUTO_INCREMENT,** ** key varchar(128) DEFAULT NULL,** ** value varchar(128) DEFAULT NULL,** ** created_at datetime NOT NULL,** ** updated_at datetime NOT NULL,** ** deleted_at datetime DEFAULT NULL,** ** PRIMARY KEY (id),** ** UNIQUE KEY unique_key (key)** ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb3;

CREATE TABLE tag ( ** id int NOT NULL AUTO_INCREMENT,** ** key varchar(256) DEFAULT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** PRIMARY KEY (id),** ** UNIQUE KEY key_index (key),** ** KEY created_at_index (created_at),** ** KEY updated_at_index (updated_at)** ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb3;

CREATE TABLE tag_resource_relation ( ** id int NOT NULL AUTO_INCREMENT,** ** resource_type varchar(255) DEFAULT NULL,** ** resource_id int DEFAULT NULL,** ** tag_id int DEFAULT NULL,** ** account_id varchar(255) DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY resource_type_index (resource_type),** ** KEY tag_id_index (tag_id),** ** KEY resource_id_index (resource_id),** ** KEY uin_index (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8mb3;

CREATE TABLE task ( ** id int NOT NULL AUTO_INCREMENT,** ** name varchar(255) DEFAULT NULL,** ** description text,** ** time_limit int DEFAULT NULL,** ** type varchar(128) DEFAULT NULL,** ** script_type varchar(128) DEFAULT NULL,** ** ansible_type varchar(128) DEFAULT NULL,** ** ansible_command text,** ** ansible_ip varchar(128) DEFAULT NULL,** ** content longtext,** ** args text,** ** user varchar(128) DEFAULT NULL,** ** instance_uuid varchar(128) DEFAULT NULL,** ** template_uuid varchar(128) DEFAULT NULL,** ** creator varchar(128) DEFAULT NULL,** ** start_time datetime DEFAULT NULL,** ** end_time datetime DEFAULT NULL,** ** status varchar(128) DEFAULT NULL,** ** is_local tinyint DEFAULT NULL,** ** package_name varchar(255) DEFAULT NULL,** ** package_version varchar(255) DEFAULT NULL,** ** http varchar(1024) DEFAULT NULL,** ** ftp varchar(1024) DEFAULT NULL,** ** source_host varchar(255) DEFAULT NULL,** ** source_path varchar(1024) DEFAULT NULL,** ** target_path varchar(1024) DEFAULT NULL,** ** ansible_playbook_name varchar(255) DEFAULT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** local_file_name varchar(255) DEFAULT NULL,** ** local_file_size varchar(255) DEFAULT NULL,** ** account_id varchar(128) DEFAULT NULL,** ** is_cron tinyint(1) DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** cron_task_id int DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY typeindex (type),** ** KEY scripttypeindex (script_type),** ** KEY ansibletypeindex (ansible_type),** ** KEY instanceuuidindex (instance_uuid),** ** KEY templateuuidindex (template_uuid),** ** KEY creatorindex (creator),** ** KEY starttimeindex (start_time),** ** KEY endtimeindex (end_time),** ** KEY statusindex (status),** ** KEY uinindex (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=21027 DEFAULT CHARSET=utf8mb3;

CREATE TABLE task_node ( ** id int NOT NULL AUTO_INCREMENT,** ** task_id int DEFAULT NULL,** ** instance_node_uuid varchar(128) DEFAULT NULL,** ** node_name varchar(128) DEFAULT NULL,** ** node_description varchar(255) DEFAULT NULL,** ** instance_uuid varchar(128) DEFAULT NULL,** ** template_uuid varchar(128) DEFAULT NULL,** ** plugin varchar(128) DEFAULT NULL,** ** start_time datetime DEFAULT NULL,** ** end_time datetime DEFAULT NULL,** ** status varchar(128) DEFAULT NULL,** ** output json DEFAULT NULL,** ** input json DEFAULT NULL,** ** is_skip tinyint DEFAULT NULL,** ** is_ignore_failed tinyint DEFAULT NULL,** ** retry int DEFAULT NULL,** ** template_node_uuid varchar(128) DEFAULT NULL,** ** created_at datetime DEFAULT NULL,** ** updated_at datetime DEFAULT NULL,** ** deleted_at datetime DEFAULT NULL,** ** index int DEFAULT NULL,** ** account_id varchar(128) DEFAULT NULL,** ** uin varchar(255) DEFAULT NULL,** ** PRIMARY KEY (id),** ** KEY instancenodeuuidindex (instance_node_uuid),** ** KEY nodenameindex (node_name),** ** KEY instanceuuidindex (instance_uuid),** ** KEY templateuuidindex (template_uuid),** ** KEY pluginindex (plugin),** ** KEY starttimeindex (start_time),** ** KEY endtimeindex (end_time),** ** KEY statusindex (status),** ** KEY taskidindex (task_id),** ** KEY uinindex (uin) USING BTREE** ) ENGINE=InnoDB AUTO_INCREMENT=106035 DEFAULT CHARSET=utf8mb3;

workflow_eninge数据库

CREATE TABLE v2_instance ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', template_uuid varchar(128) NOT NULL COMMENT '模板UUID', name varchar(128) NOT NULL COMMENT '实例名', description text COMMENT '描述', input_variables text COMMENT '输入参数', status varchar(16) NOT NULL DEFAULT 'initial' COMMENT '状态', error_message text COMMENT '错误信息', creator varchar(32) NOT NULL COMMENT '创建人', start_time timestamp NULL DEFAULT NULL COMMENT '开始时间', end_time timestamp NULL DEFAULT NULL COMMENT '结束时间', PRIMARY KEY (uuid), KEY IDX_v2_instance_update_time (update_time), KEY IDX_v2_instance_template_uuid (template_uuid), KEY IDX_v2_instance_name (name), KEY IDX_v2_instance_status (status), KEY IDX_v2_instance_creator (creator), KEY IDX_v2_instance_start_time (start_time), KEY IDX_v2_instance_end_time (end_time), KEY IDX_v2_instance_create_time (create_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_instance_event ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', instance_uuid varchar(128) NOT NULL COMMENT '实例UUID', origin varchar(128) NOT NULL COMMENT '原始对象UUID', path text COMMENT '事件路径', type varchar(32) NOT NULL COMMENT '事件类型', content text COMMENT '事件内容', PRIMARY KEY (uuid), KEY IDX_v2_instance_event_origin (origin), KEY IDX_v2_instance_event_type (type), KEY IDX_v2_instance_event_create_time (create_time), KEY IDX_v2_instance_event_update_time (update_time), KEY IDX_v2_instance_event_instance_uuid (instance_uuid) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_instance_node ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', template_uuid varchar(128) NOT NULL COMMENT '模板UUID', template_node_uuid varchar(128) NOT NULL COMMENT '模板节点UUID', instance_uuid varchar(128) NOT NULL COMMENT '实例UUID', name varchar(128) NOT NULL COMMENT '节点名', description text COMMENT '描述', plugin varchar(32) NOT NULL COMMENT '所用插件', inputs text COMMENT '入参模板', dependencies text COMMENT '依赖节点列表', condition text COMMENT '触发条件表达式', trigger_rule varchar(32) DEFAULT NULL COMMENT '触发规则', retry_limit tinyint DEFAULT NULL COMMENT '最大重试次数', ignore_failed tinyint(1) DEFAULT NULL COMMENT '忽略失败', timeout int DEFAULT NULL COMMENT '超时时间', actual_inputs text COMMENT '实际入参', status varchar(16) NOT NULL DEFAULT 'initial' COMMENT '状态', error_message text COMMENT '错误信息', outputs text COMMENT '出参', start_time timestamp NULL DEFAULT NULL COMMENT '开始时间', end_time timestamp NULL DEFAULT NULL COMMENT '结束时间', PRIMARY KEY (uuid), UNIQUE KEY UQE_v2_instance_node_instance_node_unique (instance_uuid,name), KEY IDX_v2_instance_node_plugin (plugin), KEY IDX_v2_instance_node_status (status), KEY IDX_v2_instance_node_update_time (update_time), KEY IDX_v2_instance_node_template_uuid (template_uuid), KEY IDX_v2_instance_node_template_node_uuid (template_node_uuid), KEY IDX_v2_instance_node_end_time (end_time), KEY IDX_v2_instance_node_create_time (create_time), KEY IDX_v2_instance_node_instance_uuid (instance_uuid), KEY IDX_v2_instance_node_name (name), KEY IDX_v2_instance_node_start_time (start_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_instance_var ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', instance_uuid varchar(128) NOT NULL COMMENT '实例UUID', key varchar(128) NOT NULL COMMENT '变量名', value text NOT NULL COMMENT '变量值', PRIMARY KEY (uuid), UNIQUE KEY UQE_v2_instance_var_instance_key_unique_idx (instance_uuid,key), KEY IDX_v2_instance_var_create_time (create_time), KEY IDX_v2_instance_var_update_time (update_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_template ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', name varchar(128) NOT NULL COMMENT '模板名', description text COMMENT '描述', creator varchar(32) NOT NULL COMMENT '创建人', delete_time timestamp NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (uuid), KEY IDX_v2_template_create_time (create_time), KEY IDX_v2_template_update_time (update_time), KEY IDX_v2_template_name (name), KEY IDX_v2_template_creator (creator), KEY IDX_v2_template_delete_time (delete_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_template_cron ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', template_uuid varchar(128) NOT NULL COMMENT '模板UUID', cron text NOT NULL COMMENT '定时设置', creator varchar(32) NOT NULL COMMENT '创建人', delete_time timestamp NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (uuid), UNIQUE KEY UQE_v2_template_cron_template_cron_unique_idx (template_uuid,delete_time), KEY IDX_v2_template_cron_delete_time (delete_time), KEY IDX_v2_template_cron_create_time (create_time), KEY IDX_v2_template_cron_update_time (update_time), KEY IDX_v2_template_cron_template_uuid (template_uuid), KEY IDX_v2_template_cron_creator (creator) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_template_node ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', template_uuid varchar(128) NOT NULL COMMENT '模板UUID', name varchar(128) NOT NULL COMMENT '节点名', description text COMMENT '描述', plugin varchar(32) NOT NULL COMMENT '所用插件', inputs text COMMENT '入参', dependencies text COMMENT '依赖节点列表', condition text COMMENT '触发条件表达式', trigger_rule varchar(32) DEFAULT NULL COMMENT '触发规则', retry_limit tinyint DEFAULT NULL COMMENT '最大重试次数', ignore_failed tinyint(1) DEFAULT NULL COMMENT '忽略失败', timeout int DEFAULT '3600' COMMENT '超时时间', delete_time timestamp NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (uuid), UNIQUE KEY UQE_v2_template_node_template_node_unique_idx (template_uuid,name,delete_time), KEY IDX_v2_template_node_template_uuid (template_uuid), KEY IDX_v2_template_node_name (name), KEY IDX_v2_template_node_plugin (plugin), KEY IDX_v2_template_node_delete_time (delete_time), KEY IDX_v2_template_node_create_time (create_time), KEY IDX_v2_template_node_update_time (update_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE v2_template_var ( uuid varchar(128) NOT NULL COMMENT '主键', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', update_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间', template_uuid varchar(128) NOT NULL COMMENT '模板UUID', key varchar(128) NOT NULL COMMENT '变量名', value text NOT NULL COMMENT '变量值', delete_time timestamp NULL DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (uuid), UNIQUE KEY UQE_v2_template_var_template_key_unique_idx (template_uuid,key,delete_time), KEY IDX_v2_template_var_delete_time (delete_time), KEY IDX_v2_template_var_create_time (create_time), KEY IDX_v2_template_var_update_time (update_time), KEY IDX_v2_template_var_template_uuid (template_uuid), KEY IDX_v2_template_var_key (key) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

remote_executor数据库

CREATE TABLE blacklist ( id int NOT NULL AUTO_INCREMENT, cmd text NOT NULL COMMENT '黑名单命令', disabled tinyint(1) NOT NULL COMMENT '是否启用', PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=1000000 DEFAULT CHARSET=utf8mb3 COMMENT='黑名单表';

CREATE TABLE leader_election ( holder_identity varchar(256) DEFAULT NULL, lease_duration_seconds int DEFAULT NULL, acquire_time datetime DEFAULT NULL, renew_time datetime DEFAULT NULL, leader_transitions int DEFAULT NULL, service_id varchar(56) NOT NULL, UNIQUE KEY leader_election_service_id_uindex (service_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE subtask ( subtask_uuid varchar(64) NOT NULL, task_uuid varchar(64) NOT NULL COMMENT '所属任务uuid', status varchar(16) NOT NULL COMMENT '任务状态', batch_index int NOT NULL COMMENT '所属批次号', target_type int NOT NULL COMMENT '目标类型', target_value varchar(64) NOT NULL COMMENT '目标机器', stdout text COMMENT '标准输出', stderr text COMMENT '错误输出', create_time datetime NOT NULL COMMENT '创建时间', update_time datetime NOT NULL COMMENT '更新时间', type varchar(16) NOT NULL COMMENT '通道类型', user varchar(16) NOT NULL COMMENT '执行用户', running_worker int NOT NULL DEFAULT '-1' COMMENT '抢占中的worker编号', cmd text NOT NULL COMMENT '命令', env_default tinyint(1) NOT NULL COMMENT '内置环境变量开关', env_custom json DEFAULT NULL COMMENT '自定义环境变量', error_info text COMMENT '任务执行出错信息', timeout int NOT NULL COMMENT '超时时间', job_id varchar(64) DEFAULT NULL, args json DEFAULT NULL, PRIMARY KEY (subtask_uuid), KEY task_uuid_idx (task_uuid), KEY job_id_idx (job_id), KEY status_idx (status), KEY type_idx (type), KEY batch_index_idx (batch_index), KEY target_value_idx (target_value), KEY idx_subtask_job_id (job_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='子任务表';

CREATE TABLE task ( task_uuid varchar(64) NOT NULL, status varchar(16) NOT NULL COMMENT '任务状态', target_type int NOT NULL COMMENT '目标类型', target_list json NOT NULL COMMENT '机器列表', parallel_type int NOT NULL COMMENT '并行类型', parallel_value int NOT NULL COMMENT '并行粒度', error_ignore_type int NOT NULL COMMENT '错误忽略类型', error_ignore_value int NOT NULL COMMENT '错误忽略值', cmd text NOT NULL COMMENT '命令', timeout int NOT NULL COMMENT '超时时间', type varchar(16) NOT NULL COMMENT '通道类型', user varchar(16) NOT NULL COMMENT '执行用户', env_default tinyint(1) NOT NULL COMMENT '内置环境变量开关', env_custom json DEFAULT NULL COMMENT '自定义环境变量', total_batch int NOT NULL COMMENT '包含的总批次数', running_batch int NOT NULL COMMENT '当前运行的批次', create_time datetime NOT NULL COMMENT '创建时间', update_time datetime NOT NULL COMMENT '更新时间', args json DEFAULT NULL, PRIMARY KEY (task_uuid), KEY status_idx (status) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='任务表';

agent-server 数据库详情

CREATE TABLE agent ( ip varchar(32) NOT NULL COMMENT 'IP', region varchar(32) NOT NULL COMMENT 'Region', sn varchar(128) DEFAULT NULL, id bigint NOT NULL AUTO_INCREMENT, agent varchar(64) DEFAULT NULL, version varchar(64) NOT NULL COMMENT 'Agent版本', status tinyint(1) NOT NULL COMMENT '状态', beat_time datetime DEFAULT NULL COMMENT '心跳时间', created_at datetime DEFAULT NULL COMMENT '创建时间', updated_at datetime DEFAULT NULL COMMENT '更新时间', deleted_at datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (id), KEY IDX_agent_ip (ip), KEY IDX_agent_region (region), KEY IDX_agent_agent (agent), KEY IDX_agent_version (version), KEY IDX_agent_status (status), KEY IDX_agent_ip_region_agent (ip,region,agent) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE command ( ip varchar(32) NOT NULL COMMENT 'IP', region varchar(32) NOT NULL COMMENT 'Region', sn varchar(128) DEFAULT NULL, id bigint NOT NULL AUTO_INCREMENT, uuid varchar(64) NOT NULL COMMENT 'UUID', cmd text NOT NULL COMMENT '命令内容', user varchar(64) DEFAULT NULL, env_default tinyint(1) DEFAULT '0' COMMENT '启用默认环境变量', envs text COMMENT '执行用户', timeout int DEFAULT '600' COMMENT '超时时间', status tinyint(1) NOT NULL COMMENT '状态', err_info text COMMENT '错误信息', exit_code int DEFAULT '0' COMMENT '退出码', stdout text COMMENT '标准输出', stderr text COMMENT '标准错误', start_time datetime DEFAULT NULL COMMENT '开始时间', end_time datetime DEFAULT NULL COMMENT '结束时间', created_at datetime DEFAULT NULL COMMENT '创建时间', updated_at datetime DEFAULT NULL COMMENT '更新时间', deleted_at datetime DEFAULT NULL COMMENT '删除时间', combine_output tinyint(1) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY UQE_command_uuid (uuid), KEY IDX_command_ip (ip), KEY IDX_command_region (region), KEY IDX_command_status (status), KEY IDX_command_exit_code (exit_code) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE instruction ( ip varchar(32) NOT NULL COMMENT 'IP', region varchar(32) NOT NULL COMMENT 'Region', sn varchar(128) DEFAULT NULL, id bigint NOT NULL AUTO_INCREMENT, uuid varchar(64) NOT NULL COMMENT 'UUID', type tinyint(1) NOT NULL COMMENT '指令类型', agent varchar(64) DEFAULT NULL, version varchar(64) DEFAULT NULL COMMENT 'Agent版本', download_url text COMMENT '下载URL', status tinyint(1) NOT NULL COMMENT '状态', err_info text COMMENT '错误信息', exit_code int DEFAULT '0' COMMENT '退出码', stdout text COMMENT '标准输出', stderr text COMMENT '标准错误', start_time datetime DEFAULT NULL COMMENT '开始时间', end_time datetime DEFAULT NULL COMMENT '结束时间', created_at datetime DEFAULT NULL COMMENT '创建时间', updated_at datetime DEFAULT NULL COMMENT '更新时间', deleted_at datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (id), UNIQUE KEY UQE_instruction_uuid (uuid), KEY IDX_instruction_version (version), KEY IDX_instruction_status (status), KEY IDX_instruction_exit_code (exit_code), KEY IDX_instruction_ip (ip), KEY IDX_instruction_region (region), KEY IDX_instruction_type (type), KEY IDX_instruction_agent (agent) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

CREATE TABLE node ( id bigint NOT NULL AUTO_INCREMENT, ip varchar(32) NOT NULL COMMENT 'IP', region varchar(32) NOT NULL COMMENT 'Region', port int NOT NULL DEFAULT '28080' COMMENT 'Port', status tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态,是否在线', sn varchar(128) DEFAULT NULL, created_at datetime DEFAULT NULL COMMENT '创建时间', updated_at datetime DEFAULT NULL COMMENT '更新时间', deleted_at datetime DEFAULT NULL COMMENT '删除时间', PRIMARY KEY (id), KEY IDX_node_ip (ip), KEY IDX_node_region (region), KEY IDX_node_port (port), KEY IDX_node_status (status), KEY IDX_node_sn (sn) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

业务运维

业务运维表汇总

对应模块 所属数据库名 表名 功能说明
app-manager

tap_app_manager
app_node_config 节点配置
deploy_record 部署记录
node_repo_relation 节点和制品关联表
ops_scale_task_history 扩缩容历史
ops_service_offline_task_history 服务下线任务历史
ops_task_history 任务历史
system_config 系统配置
template 模板
template_param_instance 模板参数
chronoflow_dag DAG 表
chronoflow_component 组件表
chronoflow_dag_biz DAG 业务
chronoflow_dag_define DAG 定义
chronoflow_dag_history DAG 历史
chronoflow_edge DAG 的边
chronoflow_edge_define DAG 边定义
chronoflow_edge_history DAG 边历史
chronoflow_lock 流程分布式锁
chronoflow_node 流程节点
chronoflow_node_biz 流程节点业务
chronoflow_node_biz_history 流程节点业务历史
chronoflow_node_define 流程节点定义
chronoflow_node_history 流程节点历史

业务运维表详情

tap_app_manager 数据库

CREATE TABLE app_node_config ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) DEFAULT NULL, creator varchar(128) DEFAULT NULL, modifier varchar(128) DEFAULT NULL, name varchar(64) NOT NULL, description varchar(256) NOT NULL, value varchar(256) NOT NULL, render_key varchar(64) NOT NULL, node_uuid varchar(512) NOT NULL, env_uuid varchar(512) DEFAULT NULL, env_node_id bigint(20) unsigned DEFAULT NULL, data longtext, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=161 DEFAULT CHARSET=utf8;

CREATE TABLE chronoflow_component ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, namespace varchar(64) DEFAULT NULL, service_name varchar(128) DEFAULT NULL, display_name varchar(255) DEFAULT NULL, component_type varchar(64) DEFAULT NULL, service_type varchar(64) DEFAULT NULL, query_conf text, retry_conf text, input_params text, output_params text, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_namespace (namespace), KEY idx_service_name (service_name) ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_dag ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_name varchar(128) DEFAULT NULL, dag_type varchar(128) DEFAULT NULL, dag_desc text, version bigint(20) DEFAULT NULL, expire_time bigint(20) DEFAULT NULL, input text, label text, biz text, status varchar(64) DEFAULT NULL, result varchar(64) DEFAULT NULL, log text, start_time datetime(3) DEFAULT NULL, finish_time datetime(3) DEFAULT NULL, timeout bigint(20) DEFAULT NULL, arrange_type varchar(64) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_namespace (namespace), KEY idx_dag_name (dag_name) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_dag_biz ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, field varchar(128) DEFAULT NULL, label varchar(255) DEFAULT NULL, value text, mark text, option text, PRIMARY KEY (id), KEY idx_field (field), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_dag_id (dag_id), KEY idx_namespace (namespace) ) ENGINE=InnoDB AUTO_INCREMENT=135 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_dag_biz_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, field varchar(128) DEFAULT NULL, label varchar(255) DEFAULT NULL, value text, mark text, option text, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_dag_define ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_name varchar(128) DEFAULT NULL, dag_type varchar(128) DEFAULT NULL, dag_desc text, label text, layout text, timeout bigint(20) DEFAULT NULL, arrange_type varchar(64) DEFAULT NULL, revise varchar(64) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY uk_namespace_name_revise (namespace,dag_name,revise), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_dag_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_name varchar(128) DEFAULT NULL, dag_type varchar(128) DEFAULT NULL, dag_desc text, version bigint(20) DEFAULT NULL, expire_time bigint(20) DEFAULT NULL, input text, label text, biz text, status varchar(64) DEFAULT NULL, result varchar(64) DEFAULT NULL, log text, start_time datetime(3) DEFAULT NULL, finish_time datetime(3) DEFAULT NULL, timeout bigint(20) DEFAULT NULL, arrange_type varchar(64) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_edge ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, parent_node_name varchar(128) DEFAULT NULL, node_name varchar(128) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_namespace (namespace), KEY idx_dag_id (dag_id), KEY idx_parent_node_name (parent_node_name), KEY idx_node_name (node_name) ) ENGINE=InnoDB AUTO_INCREMENT=319 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_edge_define ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, parent_node_name varchar(128) DEFAULT NULL, node_name varchar(128) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_namespace (namespace) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_edge_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, parent_node_name varchar(128) DEFAULT NULL, node_name varchar(128) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=147 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_lock ( key varchar(128) NOT NULL, expire_time bigint(20) DEFAULT NULL, uid varchar(64) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, PRIMARY KEY (key), KEY update_time (updated_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_node ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, node_name varchar(128) DEFAULT NULL, node_type varchar(64) DEFAULT NULL, service_name varchar(128) DEFAULT NULL, display_name varchar(255) DEFAULT NULL, input text, output text, biz text, query_conf varchar(255) DEFAULT NULL, retry_conf bigint(20) DEFAULT NULL, stage varchar(64) DEFAULT NULL, status varchar(64) DEFAULT NULL, result varchar(64) DEFAULT NULL, log text, current tinyint(1) DEFAULT NULL, expire_time bigint(20) DEFAULT NULL, query bigint(20) DEFAULT NULL, retry bigint(20) DEFAULT NULL, version bigint(20) DEFAULT NULL, link_param text, start_time datetime(3) DEFAULT NULL, finish_time datetime(3) DEFAULT NULL, PRIMARY KEY (id), KEY update_time (updated_at), KEY idx_namespace (namespace), KEY idx_dag_id (dag_id), KEY idx_node_name (node_name), KEY create_time (created_at) ) ENGINE=InnoDB AUTO_INCREMENT=334 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_node_biz ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, node_id bigint(20) unsigned DEFAULT NULL, node_name varchar(128) DEFAULT NULL, namespace varchar(64) DEFAULT NULL, field varchar(128) DEFAULT NULL, label varchar(255) DEFAULT NULL, value text, mark text, option text, PRIMARY KEY (id), KEY idx_field (field), KEY create_time (created_at), KEY update_time (updated_at), KEY idx_dag_id (dag_id), KEY idx_node_id (node_id), KEY idx_node_name (node_name), KEY idx_namespace (namespace) ) ENGINE=InnoDB AUTO_INCREMENT=383 DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_node_biz_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, node_id bigint(20) unsigned DEFAULT NULL, node_name varchar(128) DEFAULT NULL, namespace varchar(64) DEFAULT NULL, field varchar(128) DEFAULT NULL, label varchar(255) DEFAULT NULL, value text, mark text, option text, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_node_define ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, node_name varchar(128) DEFAULT NULL, node_type varchar(64) DEFAULT NULL, service_name varchar(128) DEFAULT NULL, display_name varchar(255) DEFAULT NULL, query_conf varchar(255) DEFAULT NULL, retry_conf bigint(20) DEFAULT NULL, node_param text, link_param text, PRIMARY KEY (id), KEY update_time (updated_at), KEY idx_namespace (namespace), KEY idx_node_name (node_name), KEY idx_service_name (service_name), KEY create_time (created_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE chronoflow_node_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(128) DEFAULT NULL, created_by varchar(128) DEFAULT NULL, updated_by varchar(128) DEFAULT NULL, dag_def_id bigint(20) unsigned DEFAULT NULL, namespace varchar(64) DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, node_name varchar(128) DEFAULT NULL, node_type varchar(64) DEFAULT NULL, service_name varchar(128) DEFAULT NULL, display_name varchar(255) DEFAULT NULL, input text, output text, biz text, query_conf varchar(255) DEFAULT NULL, retry_conf bigint(20) DEFAULT NULL, stage varchar(64) DEFAULT NULL, status varchar(64) DEFAULT NULL, result varchar(64) DEFAULT NULL, log text, current tinyint(1) DEFAULT NULL, expire_time bigint(20) DEFAULT NULL, query bigint(20) DEFAULT NULL, retry bigint(20) DEFAULT NULL, version bigint(20) DEFAULT NULL, link_param text, start_time datetime(3) DEFAULT NULL, finish_time datetime(3) DEFAULT NULL, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=155 DEFAULT CHARSET=utf8mb4;

CREATE TABLE deploy_record ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, creator varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, modifier varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, deploy_name varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, deploy_type varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, deploy_desc text COLLATE utf8mb4_unicode_ci, product_name varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, product_uuid varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, product_env_node_id bigint(20) unsigned DEFAULT NULL, component_name varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, component_uuid varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, component_env_node_id bigint(20) unsigned DEFAULT NULL, deploy_method text COLLATE utf8mb4_unicode_ci, environment_name varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, environment_uuid varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL, deploy_generic text COLLATE utf8mb4_unicode_ci, deploy_strategy text COLLATE utf8mb4_unicode_ci, deploy_batches text COLLATE utf8mb4_unicode_ci, deploy_cluster text COLLATE utf8mb4_unicode_ci, deploy_params text COLLATE utf8mb4_unicode_ci, state varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, PRIMARY KEY (id), KEY update_time (updated_at), KEY create_time (created_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE flyway_schema_history ( installed_rank int(11) NOT NULL, version varchar(50) DEFAULT NULL, description varchar(200) NOT NULL, type varchar(20) NOT NULL, script varchar(1000) NOT NULL, checksum int(11) DEFAULT NULL, installed_by varchar(100) NOT NULL, installed_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, execution_time int(11) NOT NULL, success tinyint(1) NOT NULL, PRIMARY KEY (installed_rank), KEY flyway_schema_history_s_idx (success) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE node_repo_relation ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) DEFAULT NULL, creator varchar(128) DEFAULT NULL, modifier varchar(128) DEFAULT NULL, node_uuid varchar(512) NOT NULL, source varchar(32) NOT NULL, repo_identity varchar(256) NOT NULL, node_model_uuid varchar(32) NOT NULL, artifact_name varchar(256) DEFAULT NULL, module_name varchar(256) DEFAULT NULL, PRIMARY KEY (id), UNIQUE KEY node_module (node_uuid,module_name), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

CREATE TABLE ops_scale_task_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, creator varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, modifier varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, task_name varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, task_desc text COLLATE utf8mb4_unicode_ci, state varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, product text COLLATE utf8mb4_unicode_ci, component text COLLATE utf8mb4_unicode_ci, environment text COLLATE utf8mb4_unicode_ci, task_type varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, application_type varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, generic text COLLATE utf8mb4_unicode_ci, hosts text COLLATE utf8mb4_unicode_ci, cluster text COLLATE utf8mb4_unicode_ci, params text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (id), KEY update_time (updated_at), KEY create_time (created_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE ops_service_offline_task_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, creator varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, modifier varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, task_name varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL, task_desc text COLLATE utf8mb4_unicode_ci, state varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, product text COLLATE utf8mb4_unicode_ci, component text COLLATE utf8mb4_unicode_ci, environment text COLLATE utf8mb4_unicode_ci, task_type varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, hosts text COLLATE utf8mb4_unicode_ci, cluster text COLLATE utf8mb4_unicode_ci, params text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (id), KEY update_time (updated_at), KEY create_time (created_at) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE ops_task_history ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, creator varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, modifier varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL, dag_id bigint(20) unsigned DEFAULT NULL, task_name varchar(128) COLLATE utf8_unicode_ci DEFAULT NULL, task_desc text COLLATE utf8_unicode_ci, task_type varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, deploy_method varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, application_type varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, state varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL, product longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, component longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, environment longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, artifact longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, strategy longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, resource longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, params longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE system_config ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, key varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, value text COLLATE utf8mb4_unicode_ci, PRIMARY KEY (id), UNIQUE KEY uk_system_config_key (key), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE template ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) DEFAULT NULL, creator varchar(128) DEFAULT NULL, modifier varchar(128) DEFAULT NULL, name varchar(64) NOT NULL, template json NOT NULL, labels json NOT NULL, params_info json NOT NULL, data longtext, PRIMARY KEY (id), KEY update_time (updated_at), KEY create_time (created_at) ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;

CREATE TABLE template_param_instance ( id bigint(20) unsigned NOT NULL AUTO_INCREMENT, created_at datetime(3) DEFAULT NULL, updated_at datetime(3) DEFAULT NULL, tenant_uin varchar(64) DEFAULT NULL, creator varchar(128) DEFAULT NULL, modifier varchar(128) DEFAULT NULL, name varchar(512) NOT NULL, template_id int(11) NOT NULL, labels json NOT NULL, params_value json NOT NULL, data longtext, PRIMARY KEY (id), KEY create_time (created_at), KEY update_time (updated_at) ) ENGINE=InnoDB AUTO_INCREMENT=224 DEFAULT CHARSET=utf8;

安全性设计

防止用户直接操作数据库的方法: 用户无法直接访问和操作DB,对用户操作前端均有鉴权。对于后端DB,仅有管理员DBA能够操作DB。 用户帐号密码的加密方法: 后端存储集群不涉及用户的账号密码。 角色与权限:

角色 可以访问的表与列 操作权限
root 后端存储集群所有表 CRUD所有权限

优化设计

数据库管理与维护说明

请使用存储控制路径提供API方法,调用API操作DB,不建议用户直接操作DB。