Has anyone been able to use MySql for Druid's metadata using docker-compose file please? I have spent hours but I still get errors in the druid broker component.
The reason I want to use mysql instead of postgres is because a vendor's docker container is mistakenly connecting to Druid's postgres server instead of its own and changing postgres' port didn't help.
Below are the errors I see in 'broker'.
2021-02-23T15:15:22,464 DEBUG [qtp575779772-162] org.apache.druid.jetty.RequestLog - 172.16.1.16 POST //172.16.1.13:8082/druid/v2/sql HTTP/1.1
2021-02-23T15:15:23,063 ERROR [sql[402982ef-7105-490a-83d5-8528580c36d3]] org.apache.druid.curator.discovery.ServerDiscoverySelector - No server instance found for [druid/overlord]
2021-02-23T15:15:23,063 ERROR [sql[18a217cf-13a1-444b-99b2-726a55152af1]] org.apache.druid.curator.discovery.ServerDiscoverySelector - No server instance found for [druid/coordinator]
2021-02-23T15:15:23,063 ERROR [sql[2e472014-8050-4886-81e4-4583fa601b40]] org.apache.druid.curator.discovery.ServerDiscoverySelector - No server instance found for [druid/coordinator]
2021-02-23T15:15:23,063 ERROR [sql[41ce0e01-9e49-40ae-a7df-bc01a1c0b11c]] org.apache.druid.curator.discovery.ServerDiscoverySelector - No server instance found for [druid/overlord]
2021-02-23T15:15:23,072 INFO [NodeRoleWatcher[HISTORICAL]] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider$NodeRoleWatcher - Node[http://172.16.1.14:8083] of role[historical] detected.
2021-02-23T15:15:23,073 INFO [NodeRoleWatcher[HISTORICAL]] org.apache.druid.curator.discovery.CuratorDruidNodeDiscoveryProvider$NodeRoleWatcher - Node watcher of role[historical] is now initialized.
2021-02-23T15:15:23,064 WARN [sql[18a217cf-13a1-444b-99b2-726a55152af1]] org.apache.druid.sql.http.SqlResource - Failed to handle query: SqlQuery{query='SELECT datasource FROM sys.segments GROUP BY 1', resultFormat=OBJECT, header=false, context={}, parameters=[]}
java.lang.RuntimeException: org.apache.druid.java.util.common.IOE: No known server
at org.apache.druid.sql.calcite.schema.SystemSchema.getThingsFromLeaderNode(SystemSchema.java:1008) ~[druid-sql-0.20.0.jar:0.20.0]
I found the error details. It was in the druid coordinator logs. The MySql JDBC jar file is not shipped with Druid docker image per below link. https://druid.apache.org/docs/latest/development/extensions-core/mysql.html
So I had to copy it to my Druid containers who use metadata store. It all worked like a charm after that.
Below are the details in my docker-compose file and environment file being used:
docker-compose.yml
environment