Facing communication issue while sending data from SQL to logstash

find the logs from logstash side.

[2022-09-27T15:47:00,258][ERROR][logstash.inputs.jdbc ][test][f4db26278744478bf3c5e76b57171244092a989c2d32ce74f9029d5a6e668706] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComMysqlCjJdbcExceptions::CommunicationsException: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server."}
{ 2960 rufus-scheduler intercepted an error:
2960 job:
2960 Rufus::Scheduler::CronJob "*/5 * * * * *" {}
2960 error:
2960 2960
2960 Sequel::DatabaseConnectionError
2960 Java::ComMysqlCjJdbcExceptions::CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
2960 com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(com/mysql/cj/jdbc/exceptions/SQLError.java:174)
2960 com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(com/mysql/cj/jdbc/exceptions/SQLExceptionsMapping.java:64)
2960 com.mysql.cj.jdbc.ConnectionImpl.createNewIO(com/mysql/cj/jdbc/ConnectionImpl.java:835)
2960 com.mysql.cj.jdbc.ConnectionImpl.(com/mysql/cj/jdbc/ConnectionImpl.java:455)
2960 com.mysql.cj.jdbc.ConnectionImpl.getInstance(com/mysql/cj/jdbc/ConnectionImpl.java:240)
2960 com.mysql.cj.jdbc.NonRegisteringDriver.connect(com/mysql/cj/jdbc/NonRegisteringDriver.java:199)
2960 jdk.internal.reflect.GeneratedMethodAccessor30.invoke(jdk/internal/reflect/GeneratedMethodAccessor30)
2960 jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(jdk/internal/reflect/DelegatingMethodAccessorImpl.java:43)
2960 java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:566)
2960 org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:471)
2960 org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:329)
2960 u01.ELK.$7_dot_10_dot_2.LS.vendor.bundle.jruby.$2_dot_5_dot_0.gems.sequel_minus_5_dot_38_dot_0.lib.sequel.adapters.jdbc.connect(/u01/ELK/7.10.2/LS/vendor/bundle/jruby/2.5.0/gems/sequel-5.38.0/lib/sequel/adapters/jdbc.rb:239)

===========config file in logstash.====

i have successfully connected SQL data base from logstash server in teriminal.

input {
jdbc {
jdbc_driver_library => "/usr/share/java/mysql-connector-java.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => "jdbc:mysql://iposdb-mysql-74.sero.gic..se/iposDB"
jdbc_user => "XXXX"
jdbc_password => "XXXXXXX"
jdbc_paging_enabled => true
tracking_column => "unix_ts_in_secs"
tracking_column_type => "numeric"
schedule => "*/5 * * * * *"
statement => "SELECT * FROM stagingScriptDB"
}
}
output {
file {
path => "/proj/toolsr6k/logstash/scripts_data.txt"}
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.