-
Notifications
You must be signed in to change notification settings - Fork 101
How to connect to cockroachDB using logstash jdbc output plugin? #53
Comments
What version are you using of the plugin? Also can you try increasing the timeout (it's one of the options for the plugin). The error you're getting is basically the connection pool tries to connect and make a test query within this timeout. If it fails during its setup the plugin fails with this message to prevent things from looking like they're fine |
Note that CockroachDB's story about authentication is limited. The password field for example is not used. Unless you created a user named "user" beforehand, chances are you need to use the user name "root" instead; otherwise the connection may be refused. However it seems more likely here that your JDBC driver is not registered. |
Thanks for you input @knz - typically if the JDBC driver failed to load I'd expect @Archith09 I may have sometime Wednesday to stand up a cockroach install. I'll take a look and see what I can figure out if you've not managed to figure it out before then |
@theangryangel Thanks for the inputs. I am using logstash 2.3.1 and latest version of jdbc output plugin. I tried with logstash 2.3.4 as well but does not seem to work. As suggested, I extended the connection pool timeout but in vain. And yes, it would be of great help if you could take a look at it but hopefully I figure it out by then. @knz Thanks for the input. I am using an insecure cluster in cockroachdb and hence I am not using any authentication parameters in the output plugin. Also, could you please enlighten me on how to register the driver in logstash? |
I've never used logstash. For pure Java I put my answer here: http://stackoverflow.com/questions/39047933/how-do-i-connect-to-cockroachdb-through-jdbc-from-logstash-output-plugin |
@knz thank you! |
@Archith09 It is logging an error that the connection is invalid, however it is working (inserting data) when I use this configuration (this screen capture shows it working):
The reason why it's logging the error is because cockroach isn't responding to the isValid call on this line, as it's expected. I'll alter the message so that its a warning, and says that maybe the driver isn't responding as expected. |
I've just pushed v0.3.1 to rubygems which adds the connection_test configuration parameter which suppresses this "error". Edit: |
@theangryangel It is working for me too with this configuration. Thanks for your help. Appreciate it! |
I am using logstash to create a pipeline from Postgres to CockroachDB. Below is the config.
The input plugin(source is postgres) is working fine. But I am unable to establish a connection in the output plugin(cockroachDB) using JDBC. I am facing the below error.
Destination(cockroachDB) is open for connection at the specified ip and port.
As cockroachDB JDBC connection string is very similar to postgres, I tried the below connection strings, and still the same error.
The text was updated successfully, but these errors were encountered: