Logstash jdbc pluging reconnecting attempts

(sahere rahimi) #1

hi all,
I am using jdbc pluging, my scheduling of logstash conf file is as following:

input {
jdbc {
jdbc_driver_library => "sqljdbc42.jar"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://localhost:3333;databaseName=Total"
jdbc_user => ""
jdbc_password => "
schedule => "30 9-23/1 * * *"
last_run_metadata_path => "E:\logstashlog.my_last_run"
statement => "
select @DDate1=REPLACE(MAXpDate),'/','') from Total.dbo.Total_Control
select [BaseDate_Accept_Setel]
from dbo.vw_Total where (BaseDate_Accept_Setel <= @DDate1) and (BaseDate_Accept_Setel > :sql_last_value)
use_column_value => "true"
tracking_column => "basedate_accept_setel"

after some times the connection failed and following error has been found.

[2019-03-14T17:17:05,619][ERROR][logstash.inputs.jdbc     ] Unable 
 to connect to database. Tried 1 times{:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: The TCP/IP connection to the host localhost, port 3333 has failed. Error: \"Connection timed out: no further information. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.\"."}

actually i want to logstash attempts to reconnect, it seems there are two parameters to handle this issue which are "connection_retry_attempts" and "connection_retry_attempts_wait_time". what is the best value for these parameters so that always attempts to reconnect to database?

(system) closed #2

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