Debezium mongodb3.6迁移报错解决方案(一)

错误信息:

org.apache.kafka.connect.errors.ConnectException: An exception occurred in the change event producer. This connector will be stopped.\n\tat io.debezium.pipeline.ErrorHandler.setProducerThrowable(ErrorHandler.java:50)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.streamChangesForReplicaSet(MongoDbStreamingChangeEventSource.java:134)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.execute(MongoDbStreamingChangeEventSource.java:103)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.execute(MongoDbStreamingChangeEventSource.java:59)\n\tat io.debezium.pipeline.ChangeEventSourceCoordinator.streamEvents(ChangeEventSourceCoordinator.java:174)\n\tat io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:141)\n\tat io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$startKaTeX parse error: Undefined control sequence: \n at position 41: …nator.java:109)\̲n̲\tat java.base/…RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutorKaTeX parse error: Undefined control sequence: \n at position 40: …cutor.java:628)\̲n̲\tat java.base/…establishConnectionToPrimaryKaTeX parse error: Undefined control sequence: \n at position 46: …ource.java:182)\̲n̲\tat io.debeziu…MongoPrimary.execute(ConnectionContext.java:292)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.streamChangesForReplicaSet(MongoDbStreamingChangeEventSource.java:122)\n\t… 10 more\nCaused by: com.mongodb.MongoCommandException: Command failed with error 40415 (Location40415): 'BSON field 'KaTeX parse error: Expected group as argument to '\"' at end of input: …tionTime\": {\"timestamp": {“t”: 1710223008, “i”: 1}}, “ok”: 0.0, “errmsg”: “BSON field 'KaTeX parse error: Expected group as argument to '\"' at end of input: …tion40415\", \"clusterTime”: {“clusterTime”: {“KaTeX parse error: Expected 'EOF', got '}' at position 43: …3008, \"i\": 1}}̲, \"signature\"…binary”: {“base64”: “Ko2QoaLTjGgHa5R1h7y707NeQdk=”, “subType”: “00”}}, “keyId”: 7330901964680593409}}}\n\tat com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:195)\n\tat com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:400)\n\tat com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:324)\n\tat com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:114)\n\tat com.mongodb.internal.connection.DefaultConnectionPoolKaTeX parse error: Undefined control sequence: \n at position 64: …nPool.java:603)\̲n̲\tat com.mongod…DefaultServerProtocolExecutor.execute(DefaultServer.java:252)\n\tat com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:214)\n\tat com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123)\n\tat com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:113)\n\tat com.mongodb.internal.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:328)\n\tat com.mongodb.internal.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:318)\n\tat com.mongodb.internal.operation.CommandOperationHelper.executeCommandWithConnection(CommandOperationHelper.java:201)\n\tat com.mongodb.internal.operation.CommandOperationHelper.lambda$executeCommand$4(CommandOperationHelper.java:189)\n\tat com.mongodb.internal.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:583)\n\tat com.mongodb.internal.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:189)\n\tat com.mongodb.internal.operation.AggregateOperationImpl.execute(AggregateOperationImpl.java:195)\n\tat com.mongodb.internal.operation.ChangeStreamOperation$1.call(ChangeStreamOperation.java:323)\n\tat com.mongodb.internal.operation.ChangeStreamOperationKaTeX parse error: Undefined control sequence: \n at position 39: …ation.java:319)\̲n̲\tat com.mongod…DelegateOperationExecutor.execute(MongoClientDelegate.java:184)\n\tat com.mongodb.client.internal.ChangeStreamIterableImpl.execute(ChangeStreamIterableImpl.java:204)\n\tat com.mongodb.client.internal.ChangeStreamIterableImpl.cursor(ChangeStreamIterableImpl.java:158)\n\tat com.mongodb.client.internal.ChangeStreamIterableImpl.iterator(ChangeStreamIterableImpl.java:153)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.readChangeStream(MongoDbStreamingChangeEventSource.java:332)\n\tat io.debezium.connector.mongodb.MongoDbStreamingChangeEventSource.lambda$streamChangesForReplicaSetKaTeX parse error: Undefined control sequence: \n at position 46: …ource.java:124)\̲n̲\tat io.debeziu…MongoPrimary.execute(ConnectionContext.java:288)\n\t… 11 more\n

原source connector的配置:

{
    "name": "source_mongo363_1406",
    "config": {
        "connector.class": "io.debezium.connector.mongodb.MongoDbConnector",
        "mongodb.hosts": "192.168.0.195:27017,192.168.0.197:27017",
        "topic.prefix": "source_mongo363_1406",
        "mongodb.user": "root",
        "mongodb.password": "xxx",
        "mongodb.authsource": "admin",
        "mongodb.name": "source_mongo363_1406",
        "database.include.list": "test"
    }
}

解决办法:
向source connector增加capture.mode:oplog参数即可解决问题
在这里插入图片描述

  • 9
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yiqian1989

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值