【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】4.2.4
【 使用版本 】
【问题描述】OCP 平台点击 binlog 服务报错,没有找到指定HostEntity类型的记录,参数:1000002,请检查后重试。 如果忽略这个错误,创建binlog集群会报错
【复现路径】问题出现前后相关操作
ocp是什么版本?
业务集群的OB详细版本也麻烦发下
show variables like '%version_comment%';
ocp 版本号: 4.3.4-20250114101305
MySQL [(none)]> show variables like ‘%version_comment%’;
±----------------±-----------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
±----------------±-----------------------------------------------------------------------------------------------------------------+
| version_comment | OceanBase_CE 4.2.4.0 (r100010022024091012-0e8ca8d9363eb5d5fbb56e9ed0159b949c21dc80) (Built Sep 10 2024 13:57:03) |
±----------------±-----------------------------------------------------------------------------------------------------------------+
需要获取下报错日志,麻烦按照如果步骤获取
F12打开网页调试模式–>点击binlog服务–>点击network–>找到红色且标记为的接口–>获取到traceId–>根据traceId到ocp-server.log 取出日志 :grep xxxx cop-server.log
参考:
]# grep “57f56011f8120434” ocp-server.log
2025-01-16 17:15:13.629 INFO 9853 — [http-nio-0.0.0.0-8080-exec-1,57f56011f8120434,ba6b141df9aa1e7f] c.o.o.s.c.trace.RequestTracingAspect : API: [GET /api/v2/binlog/clustersView?page=1&size=10, client=10.251.68.68, traceId=57f56011f8120434, method=PaginatedResponse com.oceanbase.ocp.server.common.controller.BinlogController.listBinlogClustersView(String,Pageable), args=Page request [number: 0, size 10, sort: name: ASC],]
2025-01-16 17:15:14.043 ERROR 9853 — [http-nio-0.0.0.0-8080-exec-1,57f56011f8120434,ba6b141df9aa1e7f] c.o.ocp.core.util.ExceptionUtils : Checked Exception: com.oceanbase.ocp.core.exception.NotFoundException occurred with code error.common.not.found, and args [HostEntity, 1000002]
2025-01-16 17:15:14.044 WARN 9853 — [http-nio-0.0.0.0-8080-exec-1,57f56011f8120434,ba6b141df9aa1e7f] c.o.o.s.c.trace.RequestTracingAspect : API Error: [GET /api/v2/binlog/clustersView client=10.251.68.68, traceId=57f56011f8120434, args=Page request [number: 0, size 10, sort: name: ASC], duration=553 ms, errorMsg=[OCP NotFoundException]: status=404 NOT_FOUND, errorCode=COMMON_NOT_FOUND, args=HostEntity,1000002]
麻烦确认下 是否跳过了什么运维任务?
另外在meta_database查下
show tables like '%binlog%';
删除了binlog进群,就报错了
show tables like ‘%binlog%’;
±-----------------------------------------+
| Tables_in_meta_database (%binlog%) |
±-----------------------------------------+
| binlog_cluster |
| binlog_instance |
| binlog_ob_compatibility_info |
| binlog_server |
| ob_tenant_binlog_service |
| ob_tenant_binlog_service_obproxy_cluster |
±-----------------------------------------+
6 rows in set (0.01 sec)
我把这个表里面的集群信息手动删除了,不报错了。
但是新建binlog集群的时候,报了 ”Unexpected error“
ocp-server.log 日志
2025-01-16 17:51:49.023 ERROR 9853 — [http-nio-0.0.0.0-8080-exec-9,2eadb769ea7212c8,50dcb66942ff90ff] c.o.ocp.common.encrypt.OcpRSAUtils : Last unit does not have enough valid bits
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
2025-01-16 17:51:49.701 WARN 9853 — [http-nio-0.0.0.0-8080-exec-9,2eadb769ea7212c8,50dcb66942ff90ff] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1062, SQLState: 23000
2025-01-16 17:51:49.701 ERROR 9853 — [http-nio-0.0.0.0-8080-exec-9,2eadb769ea7212c8,50dcb66942ff90ff] o.h.engine.jdbc.spi.SqlExceptionHelper : (conn=258752553) Duplicate entry ‘192.168.8.230-2983’ for key ‘uk_binlog_server_ip_port’
2025-01-16 17:51:49.712 ERROR 9853 — [http-nio-0.0.0.0-8080-exec-9,2eadb769ea7212c8,50dcb66942ff90ff] c.o.o.s.c.trace.RequestTracingAspect : Unexpected API Error: [POST /api/v2/binlog/clusters client=10.251.68.68, traceId=2eadb769ea7212c8, args=CreateBinlogClusterRequest(name=ob_dev_binlog, address=192.168.8.230, port=2983, rpmName=obbinlog-ce-4.2.0-100000152024122710.el7.x86_64.rpm, metadbConfig=CreateBinlogClusterRequest.BinlogClusterMetadbConfig(tenantId=2000003, username=root, database=binlog_database), servers=[1000003], startupParameters=null, runUser=admin, installPath=/mnt/admin/binlogservice, binlogFilePath=null), duration=699 ms]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
at com.oceanbase.jdbc.internal.protocol.AbstractQueryProtocol.readErrorPacket(AbstractQueryProtocol.java:2366)
2025-01-16 17:51:49.714 INFO 9853 — [http-nio-0.0.0.0-8080-exec-9,2eadb769ea7212c8,50dcb66942ff90ff] c.o.ocp.service.audit.AuditEventService : begin create audit event, param:CreateAuditEventParam(operationEvent=CREATE_BINLOG_CLUSTER, eventType=BINLOG_SERVICE_MANAGEMENT, methodSignature=com.oceanbase.ocp.server.common.controller.BinlogController.createBinlogCluster, resourceType=BINLOG_SERVICE, resources=[CreateAuditEventParam.AuditResourceParam(resourceId=null, resourceName=ob_dev_binlog, parentResource=null)], operatorId=100, operatorName=admin, status=FAILED, failedReason={“errorCode”:“COM10015”,“errorMessage”:“could not execute statement; SQL [n/a]; constraint [uk_binlog_server_ip_port]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement”}, taskId=null, eventInfo={“request”:{“address”:“192.168.8.230”,“installPath”:"/mnt/admin/binlogservice",“metadbConfig”:{“database”:“binlog_database”,“tenantId”:2000003,“username”:“root”},“name”:“ob_dev_binlog”,“password”:"******",“port”:2983,“rpmName”:“obbinlog-ce-4.2.0-100000152024122710.el7.x86_64.rpm”,“runUser”:“admin”,“servers”:[1000003]}}, executionType=NEW, requestUrl=http://192.168.8.231:8080/api/v2/binlog/clusters, clientIp=10.251.68.68, serverIp=192.168.8.231, startTime=2025-01-16T17:51:49.021+08:00, endTime=2025-01-16T17:51:49.712+08:00, role=null, aliUid=null)
删除binlog_server表内容,解决
这种报错一般是跳过了运维任务产生了脏数据导致的