Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Logstash JDBC输入插件-DB2_Db2_Logstash Jdbc - Fatal编程技术网

Logstash JDBC输入插件-DB2

Logstash JDBC输入插件-DB2,db2,logstash-jdbc,Db2,Logstash Jdbc,我正试图从本地机器连接到大型机上的DB2数据库。我正在使用JDBC输入插件。似乎没有加载jdbc驱动程序许可证文件。有人能告诉我如何加载db2jcc_license_cisuz-1.4.2.jar文件吗 我使用的是logstash版本6.2.2 我能够使用来自其他Java应用程序的相同许可证文件连接到DB2 我的配置文件如下: input { beats { port => 5044 } jdbc { jdbc_connection_

我正试图从本地机器连接到大型机上的DB2数据库。我正在使用JDBC输入插件。似乎没有加载jdbc驱动程序许可证文件。有人能告诉我如何加载db2jcc_license_cisuz-1.4.2.jar文件吗

我使用的是logstash版本6.2.2

我能够使用来自其他Java应用程序的相同许可证文件连接到DB2

我的配置文件如下:

input {
    beats {
        port => 5044
    }
    jdbc {
        jdbc_connection_string => "jdbc:db2://XX.XX.XX.XX:1304/DB91"
        jdbc_user => "username"
        jdbc_password => "password"
        jdbc_driver_library => "C:\logstash-6.2.2\logstash-6.2.2\vendor\jruby\lib\jdbc\db2jcc-1.4.2.jar"
        jdbc_driver_class => "com.ibm.db2.jcc.DB2Driver"
        statement => "SELECT * from DBTPS29.NPSXTEI"
    }
}
output {
    stdout {codec => json_lines}
}
日志文件:

[2018-08-21T11:19:24,334][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComIbmDb2JccAm::SqlSyntaxErrorException: [jcc][t4][10509][13454][3.61.96] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid \r\nor was not activated for the DB2 for z/OS subsystem. If you are connecting directly to \r\nthe data server and using DB2 Connect Unlimited Edition for System z, perform the \r\nactivation step by running the activation program in the license activation kit. \r\nIf you are using any other edition of DB2 Connect, obtain the license file, \r\ndb2jcc_license_cisuz.jar, from the license activation kit, and follow the installation \r\ndirections to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968"}
[2018-08-21T11:19:24,338][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_connection_string=>"jdbc:db2://xx.xx.xx.xx:1304/DB91", jdbc_user=>"username", jdbc_password=>, jdbc_driver_library=>"C:\logstash-6.2.2\logstash-6.2.2\vendor\jruby\lib\jdbc\db2jcc-1.4.2.jar", jdbc_driver_class=>"com.ibm.db2.jcc.DB2Driver", statement=>"SELECT * from DBTPS29.NPSXTEI", id=>"f63556360d1928aaaf73cf6a06df9ec2cc1f8252c016d62da5830f446521927e", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_bad95943-2146-4d84-a312-0be5db02acef", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validate_connection=>false, jdbc_validation_timeout=>3600, jdbc_pool_timeout=>5, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>{"sql_last_value"=>1970-01-01 00:00:00 UTC}, last_run_metadata_path=>"C:\Users\vipul.parikh/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: Java::ComIbmDb2JccAm::SqlSyntaxErrorException: [jcc][t4][10509][13454][3.61.96] Connection to the data server failed. The IBM Data Server for JDBC and SQLJ license was invalid
or was not activated for the DB2 for z/OS subsystem. If you are connecting directly to
the data server and using DB2 Connect Unlimited Edition for System z, perform the
activation step by running the activation program in the license activation kit.
If you are using any other edition of DB2 Connect, obtain the license file,
db2jcc_license_cisuz.jar, from the license activation kit, and follow the installation
directions to include the license file in the class path. ERRORCODE=-4230, SQLSTATE=42968
Exception: Sequel::DatabaseConnectionError
Stack: com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:676)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:60)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:120)
com.ibm.db2.jcc.am.jb.Qb(com/ibm/db2/jcc/am/jb.java:4339)
com.ibm.db2.jcc.am.jb.b(com/ibm/db2/jcc/am/jb.java:4248)
com.ibm.db2.jcc.t4.b.b(com/ibm/db2/jcc/t4/b.java:537)
com.ibm.db2.jcc.t4.b.a(com/ibm/db2/jcc/t4/b.java:366)
com.ibm.db2.jcc.t4.b.(com/ibm/db2/jcc/t4/b.java:305)
com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(com/ibm/db2/jcc/DB2SimpleDataSource.java:214)
com.ibm.db2.jcc.DB2Driver.connect(com/ibm/db2/jcc/DB2Driver.java:460)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.adapters.jdbc.connect(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/adapters/jdbc.rb:203)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.make_new(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool.rb:126)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.assign_connection(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:192)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.acquire(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:133)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.connection_pool.threaded.hold(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/connection_pool/threaded.rb:90)
C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.synchronize(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:269)


`C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.test_connection(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:279)
    C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.database.connecting.connect(C:/logstash-6.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/sequel-5.4.0/lib/sequel/database/connecting.rb:58)

   C_3a_.logstash_minus_6_dot_2_dot_2.logstash_minus_6_dot_2_dot_2.vendor.bundle.jruby.$2_dot_3_dot_0.gems.sequel_minus_5_dot_4_dot_0.lib.sequel.core.connect(C:/logstash-`
[2018-08-21T11:19:24334][ERROR][logstash.inputs.jdbc]无法连接到数据库。尝试了1次{:error_message=>“Java::ComIbmDb2JccAm::SqlSyntaxErrorException:[jcc][t4][10509][13454][3.61.96]与数据服务器的连接失败。IBM data server for JDBC和SQLJ许可证无效,\r\n也没有为DB2 for z/OS子系统激活。如果直接连接到数据服务器并使用DB2 Connect Unlimited Edition for System z,\r\n请通过在许可证激活中运行激活程序来执行激活步骤安装工具包。\r\n如果您使用的是任何其他版本的DB2 Connect,请从许可证激活工具包中获取许可证文件\r\ndb2jcc\u license\u cisuz.jar,然后按照安装说明将许可证文件包含在类路径中。错误代码=-4230,SQLSTATE=42968“}
[2018-08-21T11:19:24338][ERROR][logstash.pipeline]插件出现无法恢复的错误。将重新启动此插件。
管道id:主管道
插件:“jdbc:db2://xx.xx.xx.xx:1304/DB91”,jdbc_user=>“username”,jdbc_password=>,jdbc_driver_library=>“C:\logstash-6.2.2\logstash-6.2.2\vendor\jruby\lib\jdbc\db2jcc-1.4.2.jar”,jdbbc_-driver类=>“com.ibm.db2.jcc.DB2Driver”,语句=>“SELECT*from DBTPS29.xtensi”,id=>“F635563608aad1928afc146c257c257d167c285e”,enable_metric=>true,codec=>plain_bad95943-2146-4d84-a312-0be5db02acef,enable_metric=>true,charset=>UTF-8>,jdbc_paging_enabled=>false,jdbc_页面大小=>100000,jdbc_验证_连接=>false,jdbc_验证超时=>3600,jdbc_池超时=>5,sql_日志级别=>info,连接重试尝试次数=>1,连接尝试次数=>0,等待时间=>5,参数=>{“sql\u last\u value”=>1970-01-01 00:00:00 UTC},last\u run\u metadata\u path=>“C:\Users\vipul.parikh/.logstash\u jdbc\u last\u run”,use\u column\u value=>false,tracking\u column\u type=>“numeric”,clean\u run=>false,record\u last\u run=>true,小写的\u column\u name=>true>
错误:Java::ComIbmDb2JccAm::SqlSyntaxErrorException:[jcc][t4][10509][13454][3.61.96]与数据服务器的连接失败。IBM Data Server for JDBC和SQLJ许可证无效
或者没有为DB2forz/OS子系统激活。如果您直接连接到
在数据服务器上,使用DB2Connect Unlimited Edition for Systemz执行
激活步骤:运行许可证激活工具包中的激活程序。
如果您正在使用任何其他版本的DB2 Connect,请获取许可证文件,
db2jcc_license_cisuz.jar,从许可证激活工具包下载,并按照安装过程进行操作
在类路径中包含许可证文件的说明。ERRORCODE=-4230,SQLSTATE=42968
例外:Sequel::DatabaseConnectionError
堆栈:com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:676)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:60)
com.ibm.db2.jcc.am.ed.a(com/ibm/db2/jcc/am/ed.java:120)
com.ibm.db2.jcc.am.jb.Qb(com/ibm/db2/jcc/am/jb.java:4399)
com.ibm.db2.jcc.am.jb.b(com/ibm/db2/jcc/am/jb.java:4248)
com.ibm.db2.jcc.t4.b.b(com/ibm/db2/jcc/t4/b.java:537)
com.ibm.db2.jcc.t4.b.a(com/ibm/db2/jcc/t4/b.java:366)
com.ibm.db2.jcc.t4.b.(com/ibm/db2/jcc/t4/b.java:305)
com.ibm.db2.jcc.DB2SimpleDataSource.getConnection(com/ibm/db2/jcc/DB2SimpleDataSource.java:214)
connect(com/ibm/db2/jcc/DB2Driver.java:460)
invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:468)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:326)
C_3a_.logstash_减去_6_点2_点2.logstash_减去_6_点2_点2.vendor.bundle.jruby.$2_点3_点0.gems.sequel_减去_5_点4_点0.lib.sequel.adapters.jdbc.connect(C:/logstash-6.2.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/lib-4.0/sequel/jdbc/jdbc.203/jdbc)
C_3a_.logstash_减去_6_点_2_点_2.logstash_减去_6_点_2_点_2.vendor.bundle.jruby.$2_点_3_点_0.gems.sequel_减去_5_点_4_点_0.lib.sequel.connection_pool.make_new(C:/logstash-6.2.2.2/logstash-6.2.2.2.2/vendor/bundle/jruby/2.3.0/lib-5/gems/sequel.0/rb.126/sequel.126)
C_3a_.logstash_减_6_点_2_点_2.logstash_减_6_点_2_点_2.vendor.bundle.jruby.$2_点_3_点_0.gems.sequel_减_5_点_4_点_0.lib.sequel.connection_池.threaded.assign_连接(C:/logstash-6.2.2.2/logsh-6.2.2.2.2/vendor/bundle/jruby/2.3.0/4.0/gems/sequel.5/sequel.0/rb.0/192/sequel.4.0/sequel)
C_3a_.logstash_减_6_点_2_点_2.logstash_减_6_点_2_点_2.vendor.bundle.jruby.$2_点_3_点_0.gems.sequel_减_5_点_4_点_0.lib.sequel.connection_pool.threaded.acquire(C:/logstash-6.2.2.2/logstash-6.2.2.2.2/vendor/bundle/jruby/2.3.0/gems-lib-5/sequencil.0/rb.0/sequencil/rb.0/rb.133/sequencil.0/sequencil.0)
C_3a_.logstash_减_6_点_2_点_2.logstash_减_6_点_2_点_2.vendor.bundle.jruby.$2_点_3_点_0.gems.sequel_减_5_点_4_点_0.lib.sequel.connection_pool.threaded.hold.hold(C:/logstash-6.2.2.2/logstash-6.2.2.2.2/vendor/bundle/jruby/2.0/2.0/2.0/gems-lib-5.0/sequel.0/rb/90/sequel.0/sequel.0)
C_3a_.logstash_减去_6_点2_点2.logstash_减去_6_点2_点2.vendor.bundle.jruby.$2_点3_点0.gems.sequel_减去_5_点4_点0.lib.sequel.database.connecting.synchronize(C:/logstash-6.2.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/lib-5/sequel/rb.269/database.269)
`C_3a_.logstash_减去_6_点2_点2.logstash_减去_6_点2_点2.vendor.bundle.jruby.$2_点3_点0.gems.sequel_减去_5_点4_点0.lib.sequel.database.connecting.test_connection(C:/logstash-6.2.2.2/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems