Closed Ranglage closed 2 years ago
Judging from the logs you provided, it seems the query timed out after 30 seconds. Perhaps you can increasesocket_timeout
in ClickHouse jdbc driver?
There are couple of timeout you may want to tweak:
My MySQL engine is InnoDB. Also, mysql server and ch server are in same machine, so, i can't image "show databases" query will last for 30 sec (, which, after test, will return result asap in mysql client). Any other timeout possibility?
Are you running jdbc bridge in a docker container? Which version are you using? Also you'd better download mysql jdbc driver to a local folder and update datasources configuration accordingly, otherwise jdbc bridge will download the driver each time you start the server.
Thank you for your reply. Happy Lunar New Year!
I run jdbc bridge barely in ubuntu server. The version is 2.0.7. emm..I've download mysql-driver in /etc/clickhouse-jdbc-bridge/drivers/mysql-connector-java-8.0.26.jar then set driverUrls as
"driverUrls": [
"file:///etc/clickhouse-jdbc-bridge/drivers/mysql-connector-java-8.0.26.jar"
],
"driverClassName": "com.mysql.cj.jdbc.Driver",
however jdbc bridge warned
[2022-02-04 08:08:44] [INFO ] mysql - Starting...
[2022-02-04 08:08:44] [WARNING] Registered driver with driverClassName=com.mysql.cj.jdbc.Driver was not found, trying direct instantiation.
[2022-02-04 08:08:45] [INFO ] mysql - Start completed.
also, I assigned environment CLASSPATH=/etc/clickhouse-jdbc-bridge/drivers/
,
but it doesn't work.
I found another solution last night just create a table with MySQL engine. So...What is the advantage of jdbc?
Happy Chinese New Year :)
The warning message was generated by HikariCP, the connection pool used by JDBC bridge. It's not error so you can omit that.
Have you tried simple query like select * from jdbc('mysql', 'select 1')
? Basically, show datasources
can be used to understand if all defined datasources were created successfully, while you still need to issue a simple query to test if connection can be made.
I'd suggest you to use docker-compose to spin up the environment to play with.
I found another solution last night just create a table with MySQL engine. So...What is the advantage of jdbc?
As far as I know, it's convenient to use MySQL engine because it's build-in function, and requires no additional process running and/or complex configuration. It's like trino/presto in concept, but there's no connection pool(not sure about latest version) and does not support native query. JDBC bridge on the other hand provides connection pool, load balance(behind a proxy), and native query(e.g. call SP/UDF on MySQL or a long query involving multiple tables etc.).
thank you very much busy on developing maybe more question to boring you..
json config in /etc/clickhouse-jdbc-bridge/config/datasources/mysql.json
however, when i execute
it fails with
So, is the connect sussessed? Why the sql timeout?