obbinlog配置完毕后无法生成binlog

【 使用环境 】 测试环境
【 OB or 其他组件 】 obbinlog-ce V4.0.1
【 使用版本 】社区版
【问题描述】obbinlog最后配置完毕后,需要生成binlog的租户,运行show master status无binlog信息
配置信息如下
obbinlog:192.168.6.13:2983
odp: 192.168.128.31:28831
需要生成binlog的租户:monitor
全部配置完毕后
obbinlog输出如下:
| name | ob_cluster | ob_tenant | ip | port | zone | region | group | running | state | obcdc_running | obcdc_state | service_mode | convert_running | convert_delay | convert_rps | convert_eps | convert_iops | dumpers | version | odp_addr |
±-----------±-----------±----------±-------------±-----±-----±-------±------±--------±--------±--------------±------------±-------------±----------------±--------------±------------±------------±-------------±--------±-----------------------------------------------±---------+
| boc3jtzdev | ob01 | monitor | 192.168.6.13 | 8102 | | | | Yes | Running | Yes | Running | enabled | No | 0 | 0 | 0 | 0 | 0 | 4.0.1-92748c6c59534426d187977b13b61b7cdf4fa200 | NULL |
| kabr8jidbw | ob01 | monitor | 192.168.6.13 | 8100 | | | | Yes | Running | Yes | Running | enabled | No | 0 | 0 | 0 | 0 | 0 | 4.0.1-92748c6c59534426d187977b13b61b7cdf4fa200 | NULL |
| az9s6m43ix | ob01 | monitor | 192.168.6.13 | 8101 | | | | Yes | Running | Yes | Running | enabled | No | 0 | 0 | 0 | 0 | 0 | 4.0.1-92748c6c59534426d187977b13b61b7cdf4fa200 | NULL |
±-----------±-----------±----------±-------------±-----±-----

使用root@sys登录odp查询SHOW PROXYCONFIG LIKE ‘binlog_service_ip’;如下
±----------------------±------±-----------------------------------------------------------±------------±--------------+
| name | value | info | need_reboot | visible_level |
±----------------------±------±-----------------------------------------------------------±------------±--------------+
| enable_binlog_service | True | if enabled, obproxy will send binlog request to OBLogProxy | false | SYS |
±----------------------±------±-----------------------------------------------------------±------------±--------------+

查看指定租户的 Binlog 任务的实例运行状态如下
SHOW BINLOG STATUS FOR TENANT ob01.monitor;
| cluster | tenant | status |
±--------±--------±-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ob01 | monitor | {“binlog_instance”:“kabr8jidbw”,“resources_metrics”:{“client_id”:"/data/oblogproxy/run/kabr8jidbw",“fd_count”:11,“pid”:6143,“cpu_status”:{“cpu_count”:8,“cpu_used_ratio”:0.0},“disk_status”:{“disk_total_size_mb”:307048,“disk_usage_size_process_mb”:0,“disk_used_ratio”:0.0,“disk_used_size_mb”:18525},“memory_status”:{“mem_total_size_mb”:32012,“mem_used_ratio”:0.0004998125950805843,“mem_used_size_mb”:16},“network_status”:{“network_rx_bytes”:29676,“network_wx_bytes”:88455}},“binlog_files”:[]} |
±--------±--------±-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

使用需要生成binlog的租户登录odp后
show master status;
无binlog
odp日志
2024-12-11 15:45:17.225384,ob01,ob01:monitor:oceanbase,OB_MYSQL,OB_MYSQL_COM_QUERY,OTHERS,success,show master status,260278us,218025us,0us,719us,Y0-00001543B042F060,0,192.168.6.13:8100

obbinlog日志
[2024-12-11 15:45:17.320416] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/kabr8jidbw/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.320459] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.321896] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.321941] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/az9s6m43ix/binlog_instance.socket
[2024-12-11 15:45:17.322532] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/kabr8jidbw/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.322615] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/kabr8jidbw/binlog_instance.socket
[2024-12-11 15:45:17.326790] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.328045] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:17.328096] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/boc3jtzdev/binlog_instance.socket
[2024-12-11 15:45:18.332799] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.333233] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.333427] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/kabr8jidbw/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.334570] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.334635] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/az9s6m43ix/binlog_instance.socket
[2024-12-11 15:45:18.335094] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.335143] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/boc3jtzdev/binlog_instance.socket
[2024-12-11 15:45:18.336010] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/kabr8jidbw/binlog_instance.socket, user: OBM
[2024-12-11 15:45:18.336065] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/kabr8jidbw/binlog_instance.socket
[2024-12-11 15:45:19.342723] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:19.343593] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:19.343949] [info] mysql_protocol.cpp(70): Connect to server through unix domain socket success: ./run/kabr8jidbw/binlog_instance.socket, user: OBM
[2024-12-11 15:45:19.344379] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/az9s6m43ix/binlog_instance.socket, user: OBM
[2024-12-11 15:45:19.344422] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/az9s6m43ix/binlog_instance.socket
[2024-12-11 15:45:19.345137] [info] mysql_protocol.cpp(129): Auth user success of server: ./run/boc3jtzdev/binlog_instance.socket, user: OBM
[2024-12-11 15:45:19.345221] [info] instance_client.cpp(69): Successfully login binlog instance, is_local: true, addr: ./run/boc3jtzdev/binlog_instance.socket

ob的版本号 obproxy的版本号 发一下 run/${instance_name}/log ,确认该目录中的文件是否包含 ERROREDIAG 信息。

observer (OceanBase_CE 4.2.5.0)
obproxy (OceanBase 4.2.1.0 11.el8)
只有最初启动有error,但是show master status时,无报错信息

[2024-12-11 11:30:57.150021] [info] binlog_instance_entry.cpp(63): Begin to start binlog instance with given params, work path: ./run/az9s6m43ix, config file: binlog_instance.conf, tcp port: 8101
[2024-12-11 11:30:57.160794] [info] mysql_protocol.cpp(55): Connect to server success: 192.168.128.32:2881, user: root
[2024-12-11 11:30:57.164605] [info] mysql_protocol.cpp(129): Auth user success of server: 192.168.128.32:2881, user: root
[2024-12-11 11:30:57.219379] [info] mysql_protocol.cpp(55): Connect to server success: 192.168.128.32:2881, user: root
[2024-12-11 11:30:57.223035] [info] mysql_protocol.cpp(129): Auth user success of server: 192.168.128.32:2881, user: root
[2024-12-11 11:30:57.324463] [info] instance_meta.cpp(143): Binlog instance [az9s6m43ix] server options, cluster_id: 1, tenant_id: 1018
[2024-12-11 11:30:57.324581] [info] instance_meta.cpp(114): Binlog instance [az9s6m43ix] server options, master_server_id: 1, master_server_uuid: 622dda0b-ab0b-11ef-a58d-9418827a901d, server_id: 13302245, server_uuid: 6ba49321-1e41-2136-a36b-40d9fed6f282,cluster_id: 1, tenant_id: 1018
[2024-12-11 11:30:57.324760] [error] binlog_index.cpp(118): Failed to open binlog index file: ./data/mysql-bin.index, error: 2(No such file or directory)
[2024-12-11 11:30:57.324940] [error] gtid_manager.cpp(451): Failed to open gtid seq file: binlog_tenant_gtid_seq.meta, error: 2(No such file or directory)
[2024-12-11 11:30:57.325001] [info] gtid_manager.cpp(290): Failed to open gtid seq file: binlog_tenant_gtid_seq.meta, error: 2(No such file or directory)
[2024-12-11 11:30:57.325028] [error] binlog_index.cpp(49): Failed to open index file: ./data/mysql-bin.index, errno: 2(No such file or directory)
[2024-12-11 11:30:57.325090] [info] gtid_manager.cpp(381): Init global variables [gtid_purged = , gtid_executed = ] when first startup: true
[2024-12-11 11:30:57.325757] [info] rate_limiter.cpp(42): Begin to disable throttle rps: 0
[2024-12-11 11:30:57.325804] [info] rate_limiter.cpp(62): Begin to disable throttle iops: 0
[2024-12-11 11:30:57.325935] [info] thread.cpp(44): << Joining thread: (6143)
[2024-12-11 11:30:57.325976] [info] event_wrapper.cpp(45): Succeed to listen socket with port: 8101
[2024-12-11 11:30:57.326006] [info] instance_socket_listener.cpp(47): Start OceanBase binlog instance on port: 8101.
[2024-12-11 11:30:57.326166] [info] event_wrapper.cpp(74): Succeed to listen socket with socket path: binlog_instance.socket

有业务在跑着没? 或者你创建个表 插入几条数据看看?

binlog文件再 run目录下面。

建库,建表,还插了数据,log下无报错信息。data目录下无binlog文件

  1. show parameters like ‘%obconfig_url%’; --odp执行
  2. 发下 创还能binlog server实例的命令
  3. SHOW PROXYCONFIG LIKE ‘binlog_service_ip’; --这几个看下

convert_running 是 false,说明 binlog 实例没有完全启动成功。

另外看你那边用的是 ob 4.2.5, obbinlog 4.0.1 目前还没有适配 4.2.5,所以这个问题可能是版本不适配引起的,你可以看一下 run/{instance_name}/log 下边的 obcdc 的日志里有没有 EDIAG 或者 ERROR 信息。如果想适配 ob 4.2.5,需要手动安装一下 4.2.5 的 obcdc。https://www.oceanbase.com/docs/community-oblogproxy-doc-1000000001493746

1 个赞

obclient [oceanbase]> show parameters like ‘%obconfig%’;
±-------±---------±---------------±---------±-------------±----------±----------------------------------------------------------------------------------------------------------±-------------------------±---------±--------±--------±------------------±--------------±----------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | default_value | isdefault |
±-------±---------±---------------±---------±-------------±----------±----------------------------------------------------------------------------------------------------------±-------------------------±---------±--------±--------±------------------±--------------±----------+
| zone01 | observer | 192.168.128.31 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
| zone03 | observer | 192.168.128.33 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
| zone02 | observer | 192.168.128.32 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
| zone02 | observer | 192.168.128.35 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
| zone01 | observer | 192.168.128.34 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
| zone03 | observer | 192.168.128.36 | 2882 | obconfig_url | NULL | http://192.168.128.154:8080/services?Action=ObRootServiceInfo&User_ID=alibaba&UID=ocpmaster&ObRegion=ob01 | URL for OBConfig service | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | | 0 |
±-------±---------±---------------±---------±-------------±----------±----------------------------------------------------------------------------------------------------------±-------------------------±---------±--------±--------±------------------±--------------±----------+

SHOW PROXYCONFIG LIKE ‘binlog_service_ip’;如下
±----------------------±------±-----------------------------------------------------------±------------±--------------+
| name | value | info | need_reboot | visible_level |
±----------------------±------±-----------------------------------------------------------±------------±--------------+
| enable_binlog_service | True | if enabled, obproxy will send binlog request to OBLogProxy | false | SYS |
±----------------------±------±-----------------------------------------------------------±------------±--------------+

创建binlog实例的命令
CREATE BINLOG FOR TENANT ob01.monitor
WITH CLUSTER URL http://192.168.128.154:8080/services?Action=ObRootServiceInfo&ObCluster=ob01
, REPLICATE NUM 3;