【发布时间】:2020-07-10 04:01:09
【问题描述】:
我正在尝试在下面创建 mongo debezium 连接器,但出现身份验证错误。请在下面找到详细信息
发布 http://localhost:8083/connectors
有效载荷:
{
"name": "mongodb-connector",
"config": {
"connector.class": "io.debezium.connector.mongodb.MongoDbConnector",
"mongodb.hosts": "host1:27020,host2:27020",
"mongodb.name": "op_log",
"mongodb.user": "useradmin",
"mongodb.password":"userpassword",
"mongodb.authsource":"admin"
}
}
错误详情
com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=null, userName='useradmin', source='config', password=<hidden>, mechanismProperties={}}
at com.mongodb.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:61)
at com.mongodb.connection.DefaultAuthenticator.authenticate(DefaultAuthenticator.java:32)
at com.mongodb.connection.InternalStreamConnectionInitializer.authenticateAll(InternalStreamConnectionInitializer.java:99)
at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:44)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:128)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mongodb.MongoCommandException: Command failed with error 18: 'Authentication failed.' on server 10.51.19.113:27020. The full response is { "operationTime" : { "$timestamp" : { "t" : 1585508571, "i" : 1 } }, "ok" : 0.0, "errmsg" : "Authentication failed.", "code" : 18, "codeName" : "AuthenticationFailed", "$clusterTime" : { "clusterTime" : { "$timestamp" : { "t" : 1585508571, "i" : 1 } }, "signature" : { "hash" : { "$binary" : "f5msklBnUsfygvd+lCDdJVj3/a4=", "$type" : "0" }, "keyId" : { "$numberLong" : "6784723618031992833" } } } }
at com.mongodb.connection.CommandHelper.createCommandFailureException(CommandHelper.java:170)
at com.mongodb.connection.CommandHelper.receiveCommandResult(CommandHelper.java:123)
at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)
at com.mongodb.connection.SaslAuthenticator.sendSaslStart(SaslAuthenticator.java:95)
at com.mongodb.connection.SaslAuthenticator.authenticate(SaslAuthenticator.java:45)
... 6 more
看到错误,机制为 null,在 mongodb 中我使用 SCRAM-SHA-1 作为身份验证机制。
【问题讨论】:
-
您能指定您使用的 debezium 版本吗?
-
我正在使用 debezium 1.1 版以下是相同的详细文档:debezium.io/documentation/reference/1.1/connectors/mongodb.html
标签: mongodb authentication apache-kafka-connect debezium