I'm currently working through the Elastic Engineer I (On-Demand) course and I am stuck on Lab 1.4
In trying to setup Logstash
./logstash-7.3.1/bin/logstash -f datasets/blogs_sql.conf
I get the following as output:
[2020-06-09T16:27:49,162][ERROR][logstash.inputs.jdbc ] Unable to connect to database. Tried 1 times {:error_message=>"Java::OrgPostgresqlUtil::PSQLException: The connecti
on attempt failed."}
[2020-06-09T16:27:49,166][ERROR][logstash.javapipeline ] A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Jdbc jdbc_user=>"postgres", jdbc_password=><password>, statement=>"SELECT * from blogs", jdbc_driver_library=>"/home/elastic/postgresql-42.2.9.jar
", jdbc_connection_string=>"jdbc:postgresql://db_server:5432/", id=>"a9d0f3110d44787ac0e892416603c3654611ac23e390369c6e712c0e89499869", jdbc_driver_class=>"org.postgresql.Driv
er", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_e43e7846-d7a3-4712-b752-838f2c7ce430", 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=>"/home/elastic/.logstash_jdbc_last_run", use_column_value=>fals
e, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true, lowercase_column_names=>true>
Error: Java::OrgPostgresqlUtil::PSQLException: The connection attempt failed.
Exception: Sequel::DatabaseConnectionError
Stack: org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(org/postgresql/core/v3/ConnectionFactoryImpl.java:292)
This then just repeats as it continues to try and connect.
Any help would be greatly appreciated.