【问题标题】:Invalid value java.sql.SQLException: The application requester cannot establish the connection无效值 java.sql.SQLException:应用程序请求者无法建立连接
【发布时间】:2018-10-08 11:12:02
【问题描述】:

ibm db2 as400 的 jdbc jar 文件位于:

/confluent-4.1.0/share/java/kafka-connect-jdbc\jt400.jar

I am trying to configure the source file from Json file 
{ 
"name":"SOURCE_NAME", 
"config":{ 
"connector.class":"io.confluent.connect.jdbc.JdbcSourceConnector", 
"tasks.max":"1", 
"topic.prefix":"TOPIC_NAME", 
"connection.url":"jdbc:as400://IP_ADDRESS:PORT;libraries=DATABASE;", 
"connection.user":"USER_NAME", 
"connection.password":"PASSWORD", 
"key.converter": "io.confluent.connect.avro.AvroConverter", 
"key.converter.schema.registry.url": "http://localhost:8081", 
"value.converter": "io.confluent.connect.avro.AvroConverter", 
"value.converter.schema.registry.url": "http://localhost:8081", 
"log4j.logger.io.confluent.connect.jdbc":"DEBUG", 
"mode": "incrementing", 
"incrementing.column.name": "ID", 
"query": "SELECT * FROM TABLE", 
"poll.interval.ms": "60000", 
"batch.max.rows": "10000", 
"table.types": "TABLE", 
"plugin.path":"/confluent-4.1.0/share/java" 
} 
}

我遇到错误

{"error_code":400,"message":"Connector configuration is invalid and contains the following 2 error(s): 
Invalid value java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) for configuration Couldn't open connection to jdbc:as400://IP_ADDRESS:PORT/DATABASE 
Invalid value java.sql.SQLException: The application requester cannot establish the connection. (Connection refused (Connection refused)) for configuration Couldn't open connection to jdbc:as400://IP_ADDRESS:PORT/DATABASE 
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}

我已经成功地为 Microsoft SQL Server 配置了 Connect 源,并且配置看起来非常相似。这里可能出了什么问题。

【问题讨论】:

  • 您的数据库不接受连接...不是连接问题。
  • 您的 AS400 数据库不在您指定的端口上,或者无法通过 IP 地址访问,或者您的主机被防火墙阻止(尽管这通常会导致连接超时) . Connection denied 是一个低级套接字错误,这意味着将初始 SYN 发送到 IP_ADDRESS:PORT 得到了 RST 作为回复。

标签: java jdbc apache-kafka apache-kafka-connect confluent-platform


【解决方案1】:

到目前为止,Kafka-Connect 不支持 AS400。如果您需要 AS400 支持,请在 JDBC 连接器的 db2 dialect 下添加 AS400 并重建连接器

【讨论】:

    【解决方案2】:

    目前 Kafka-jdbc-connector(Confluent) 不支持 DB2 AS400/iseries。 如果您想使用 db2 AS400,请在 as400 dialect Providers 中添加“as400”,在 pom.xml 中添加依赖项“jt400”并加载“com. ibm.as400.access.AS400JDBCDriver”在“GenericDatabaseDialect”类中建立连接之前。 在 DB2 Dialect 中添加提供程序

     public Provider() {
      super(Db2DatabaseDialect.class.getSimpleName(), "db2", "db2j", "ibmdb","as400");
    }
    

    在通用数据库方言中添加 AS400 Jdbc 驱动

        try {
      Class.forName("com.ibm.as400.access.AS400JDBCDriver");
    } catch (ClassNotFoundException e) {
      throw new SQLException("AS400JDBC Driver Not found");
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-24
      • 2016-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-27
      • 2014-01-15
      相关资源
      最近更新 更多