【 TiDB 使用环境】生产环境 /测试/ Poc
【 TiDB 版本】5.4.1
【遇到的问题】想通过CDCClient实时同步tidb,调用TiSession.create(tiConfiguration).getCatalog()时报错
Exception in thread “main” java.lang.RuntimeException: org.tikv.common.exception.GrpcException: retry is exhausted.
at com.aliyun.qijun.App.main(App.java:91)
Caused by: org.tikv.common.exception.GrpcException: retry is exhausted.
at org.tikv.common.util.ConcreteBackOffer.logThrowError(ConcreteBackOffer.java:235)
at org.tikv.common.util.ConcreteBackOffer.doBackOffWithMaxSleep(ConcreteBackOffer.java:220)
at org.tikv.common.util.ConcreteBackOffer.doBackOff(ConcreteBackOffer.java:160)
at org.tikv.common.operation.PDErrorHandler.handleRequestError(PDErrorHandler.java:82)
at org.tikv.common.policy.RetryPolicy.callWithRetry(RetryPolicy.java:97)
at org.tikv.common.AbstractGRPCClient.callWithRetry(AbstractGRPCClient.java:89)
at org.tikv.common.PDClient.getTimestamp(PDClient.java:160)
at org.tikv.common.TiSession.getTimestamp(TiSession.java:320)
at org.tikv.common.TiSession.createSnapshot(TiSession.java:326)
at org.tikv.common.catalog.Catalog.(Catalog.java:44)
at org.tikv.common.TiSession.getCatalog(TiSession.java:357)
at com.aliyun.qijun.App.main(App.java:89)
Caused by: org.tikv.shade.io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 0.199831333s. [buffered_nanos=201331500, waiting_for_connection]
at org.tikv.shade.io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:287)
at org.tikv.shade.io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:268)
at org.tikv.shade.io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:175)
at org.tikv.common.AbstractGRPCClient.lambda$callWithRetry$0(AbstractGRPCClient.java:92)
at org.tikv.common.policy.RetryPolicy.callWithRetry(RetryPolicy.java:88)
… 7 more
【复现路径】做过哪些操作出现的问题
- tidb在一台阿里云ecs上通过tiup cluster搭建,包括1 tidb,1 tikv,1 pd,1 tiflash,数据库相关功能正常,http://<公网ip>:2379/dashboard也可以正常打开
- 通过下列代码去连接时在session.getCatalog()时抛出上述的异常,pd 2379端口,tikv 20160 20180端口都已打开,我把这部分代码打成jar包到部署tidb的ecs上去执行时(同样通过公网ip)就可以执行
TiConfiguration tiConfiguration = TiConfiguration.createDefault(“http://公网ip:2379”);
TiSession session = TiSession.create(tiConfiguration);
TiTableInfo table = null;
try {
Catalog catalog = session.getCatalog();
table = catalog.getTable(“test”, “test_1024_1”);
} catch (Exception e) {
throw new RuntimeException(e);
}
【问题现象及影响】
【附件】
不知道有没有碰到类似问题的大佬