由于不可能更新debezium连接器 [DBZ-175],因此我试图创建多个连接器以容纳新表。但是,当我通过curl命令注册新的连接器时,以前的连接器失败。总是最新的连接器处于活动状态,而以前的所有连接器均失败。
当我检查先前连接器的状态时,输出如下:
{
"name":"mysql-connector-root-user",
"connector":{
"state":"RUNNING",
"worker_id":"10.0.0.216:8083"
},
"tasks":[
{
"state":"FAILED",
"trace":"org.apache.kafka.connect.errors.ConnectException: Error reading MySQL variables: Access denied for user 'root'@'ip-10-0-0-160.us-west-1.compute.internal' (using password: YES)\n\tat io.debezium.connector.mysql.MySqlJdbcContext.readMySqlSystemVariables(MySqlJdbcContext.java:266)\n\tat io.debezium.connector.mysql.MySqlTaskContext.<init>(MySqlTaskContext.java:79)\n\tat io.debezium.connector.mysql.MySqlTaskContext.<init>(MySqlTaskContext.java:55)\n\tat io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:58)\n\tat io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:45)\n\tat org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:164)\n\tat org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:170)\n\tat org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:214)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\nCaused by: java.sql.SQLException: Access denied for user 'root'@'ip-10-0-0-160.us-west-1.compute.internal' (using password: YES)\n\tat com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)\n\tat com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)\n\tat com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)\n\tat com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)\n\tat com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253)\n\tat com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)\n\tat com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)\n\tat com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)\n\tat com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:423)\n\tat com.mysql.jdbc.Util.handleNewInstance(Util.java:425)\n\tat com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)\n\tat com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)\n\tat io.debezium.jdbc.JdbcConnection.lambda$patternBasedFactory$1(JdbcConnection.java:162)\n\tat io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:590)\n\tat io.debezium.jdbc.JdbcConnection.connection(JdbcConnection.java:585)\n\tat io.debezium.jdbc.JdbcConnection.connect(JdbcConnection.java:275)\n\tat io.debezium.connector.mysql.MySqlJdbcContext.readMySqlSystemVariables(MySqlJdbcContext.java:249)\n\t... 12 more\n",
"id":0,
"worker_id":"10.0.0.160:8083"
}
],
"type":"source"
}
我正在使用的连接器配置为: 连接器1
sudo curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d '{ "name": "mysql-connector-root-user", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "database.hostname": "10.0.0.160", "database.port": "3306", "database.user": "root", "database.password": "root12345", "database.server.id": "2", "database.server.name": "MySql-root", "database.history.kafka.bootstrap.servers": "10.0.0.160:9093,10.0.0.216:9093", "database.history.kafka.topic": "database_history_2" , "include.schema.changes": "true", "table.whitelist": "Debezium_test.recipes" } }'
连接器2
sudo curl -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d '{ "name": "mysql-connector-root-user2", "config": { "connector.class": "io.debezium.connector.mysql.MySqlConnector", "database.hostname": "10.0.0.160", "database.port": "3306", "database.user": "root", "database.password": "root12345", "database.server.id": "3", "database.server.name": "MySql-root2", "database.history.kafka.bootstrap.servers": "10.0.0.160:9093,10.0.0.216:9093", "database.history.kafka.topic": "database_history_3" , "include.schema.changes": "true", "table.whitelist": "test.person_details" } }'
对此将提供任何帮助。