首批通过分布式安全可靠测评,为关键业务系统打造
元数据信息
更新时间:2026-05-21 15:12:27
Binlog 服务部署完成后,部署脚本会在元数据库的指定 database 下创建出如下的元数据表,这些表中,除了 config_template 之外,一般不需要手动进行修改。
| 表名 | 存储内容 |
|---|---|
| binlog_instances | Binlog 实例信息。 |
| config_template | Binlog 服务的配置参数。 |
| instances_gtid_seq | Binlog 实例的 gtid 记录。 |
| nodes | Binlog 服务的节点信息。 |
| primary_instance | Binlog 服务中的主实例信息。 |
| tasks | Binlog 实例的操作记录,任务类型包括:0(创建)、1(删除)、2(停止)、3(启动)、4(恢复)。 |
| user | Binlog 服务内模块间鉴权使用的账密信息。 |
集群配置参数
config_template 存储了 Binlog 集群的主要配置参数,主要有以下配置项:
说明
当
config_template表中存在与conf/conf.json不一致的配置时,将以config_template表中的值为准。下表 bool 类型的属性中,取值
0代表false,1代表true。
| 属性 | 默认值 | 说明 |
|---|---|---|
| binlog_expire_logs_seconds | 259200 | Binlog 文件过期时间,单位:秒 |
| binlog_expire_logs_size | 53687091200 | Binlog 文件过期大小,单位:byte |
| auto_start_obcdc | 1 | 控制在 Binlog 实例启动后,是否自动开启 obcdc 进行日志拉取 |
| active_state_after_boot | 0 | 控制 Binlog 实例启动后,该实例是否处于 active(可对外提供服务)状态 |
| failover | 1 | 控制是否开启该 Binlog 实例本身的故障恢复。若开启,当所在机器节点本身正常但 Binlog 实例故障时,该 Binlog 实例将被自动恢复。 |
| remote_failover | 0 | 控制是否支持异节点故障恢复。异节点故障恢复功能由 remote_failover 和 failover 共同控制:
|
| binlog_gtid_display | true | 控制是否展示 GTID 信息 |
| binlog_ddl_convert | true | 控制是否开启 DDL 转换,转换会丢弃 OceanBase 数据库的超集语法 |
| binlog_memory_limit | 4G | obcdc 的内存使用上限,对应 obcdc 的配置参数 memory_limit |
| binlog_working_mode | storage | obcdc 的工作模式,对应 obcdc 的配置参数 working_mode |
| binlog_recover_backup | true | 控制是否开启 Binlog 备份恢复 |
| gtid_seq_compressed_interval_s | 10 | gtid seq 压缩周期 |
| gtid_seq_compressed_trx_size | 100000 | gtid seq 事务大小 |
| gtid_marking_step_size | 100000 | gtid 标记步长 |
| gtid_inspector_s | 900 | gtid 一致性巡检周期,单位:秒 |
| gtid_memory_cache_seconds | 7200 | gtid 在内存中缓存的时间,单位:秒 |
| gtid_heartbeat_duration_s | 3600 | gtid 心跳周期,单位:秒 |
| recovery_point_strategy | fast | OBI 异节点拉起时恢复策略 |
| max_binlog_size | 536870912 | 单个 Binlog 文件最大大小,单位:字节 |
| binlog_log_heartbeat_interval_times | 10 | 在运行日志中打印心跳信息的周期个数 |
| verbose_record_read | false | 控制是否打印记录读取详细信息 |
| binlog_ignore_unsupported_event | true | 控制是否跳过不支持转换的 event |
| binlog_max_event_buffer_bytes | 67108864 | binlog events 转换的 buffer 大小 |
| binlog_convert_timeout_us | 10000 | 转换超时时间,单位:微秒 |
| enable_resource_check | true | 控制是否开启资源检查 |
| node_cpu_limit_threshold_percent | 80 | CPU 检测阈值百分比 |
| node_mem_limit_threshold_percent | 85 | 内存检测阈值百分比 |
| node_disk_limit_threshold_percent | 70 | 磁盘检测阈值百分比 |
| enable_dumper_interception | false | 控制是否开启订阅拦截 |
| max_dumper_num | 128 | OBI 最大接入订阅数量 |
| default_instance_replicate_num | 1 | 创建 OBI 时的默认副本数 |
| max_task_execution_time_s | 600 | 任务最大执行时间,单位:秒 |
| default_defer_drop_sec | 0 | 异步执行删除操作的延迟时间 |
| binlog_ddl_convert_ignore_unsupported_ddl | true | 控制是否忽略不支持转换的 ddl |
| prometheus_unused_metric_clear_interval_s | 900 | 未使用的 metric 清理周期,单位:秒 |
| enable_auth | false | 控制是否开启 OBM 与 OBI 之间的连接鉴权 |
| read_wait_num | 20000 | clog Event 最大攒批大小 |
| storage_wait_num | 20000 | Binlog Event 最大攒批大小 |
| read_timeout_us | 10000 | clog Event 最大攒批时间,单位:微秒 |
| storage_timeout_us | 10000 | Binlog Event 最大攒批时间,单位:微秒 |
| binlog_convert_ring_buffer_size | 1024 | 转换队列环形缓冲区大小,该值只能为 2 的幂 |
| binlog_convert_thread_size | 16 | 转换线程池大小,需要大于 binlog_convert_number_of_concurrences 的值 |
| binlog_convert_number_of_concurrences | 12 | 转换并发数 |
| binlog_serialize_ring_buffer_size | 1024 | 并行序列化环形缓冲区大小,该值只能为 2 的幂 |
| binlog_serialize_thread_size | 10 | 序列化线程池大小,需要大于 binlog_serialize_parallel_size 的值 |
| binlog_serialize_parallel_size | 8 | 序列化实际并发数 |
| binlog_release_ring_buffer_size | 1024 | Binlog Event 释放环形缓冲区大小,该值只能为 2 的幂 |
| binlog_release_thread_size | 4 | 释放线程池大小,需要大于 binlog_release_parallel_size 的值 |
| binlog_release_parallel_size | 2 | 释放并发数 |
| preallocated_memory_bytes | 2097152 | 序列化每批 Binlog Event 预分配空间大小,单位:字节 |
| preallocated_expansion_memory_bytes | 8192 | 序列化每批 Binlog Event 预分配空间大小扩展步长,单位:字节 |
| binlog_purge_binlog_threads | 2 | 异步清理 Binlog 文件的线程池大小 |
上述属性均可以通过 SQL 直接对某个属性进行修改,如通过以下 SQL 关闭资源使用率检查。
UPDATE config_template SET value='false' WHERE key_name='enable_resource_check';
修改完成后,需要重启 Binlog Server 节点以使变更生效。
supervisord 重启
当 Binlog Server 通过部署脚本
env/deploy.sh启动且supervise_start配置为true时,脚本会安装 supervisord 并使用 supervisord 启动程序,您可执行如下命令重启 Binlog Server。[admin@test001 oblogproxy]$ supervisorctl restart binlog非 supervisord 重启
除通过部署脚本
env/deploy.sh启动 Binlog Server 且supervise_start配置为true外的其他场景,您都可执行如下命令重启 Binlog Server。[admin@test001 oblogproxy]$ sudo ./run.sh stop [admin@test001 oblogproxy]$ sudo ./run.sh start
说明
上述操作不会修改正在运行的 Binlog 实例,如果您想更新一个已有的 Binlog 实例,建议您重新创建。