Skip to content

MySQL extension with MariaDB connector docs#11608

Merged
clintropolis merged 5 commits intoapache:masterfrom
clintropolis:maria-db-docs
Aug 19, 2021
Merged

MySQL extension with MariaDB connector docs#11608
clintropolis merged 5 commits intoapache:masterfrom
clintropolis:maria-db-docs

Conversation

@clintropolis
Copy link
Copy Markdown
Member

Follow-up to #11402, adding docs for using MySQL extension with MariaDB connector library. Also, a log statement so Druid reports which driver class it is attempting to use.

Copy link
Copy Markdown
Contributor

@techdocsmith techdocsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some typos & style changes.

This module can be used side to side with other lookup module like the global cached lookup module.

To use this extension please make sure to [include](../../development/extensions.md#loading-extensions) `druid-lookups-cached-single` as an extension.
To use this extension please make sure to [include](../extensions.md#loading-extensions) `druid-lookups-cached-single` as an extension.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To use this extension please make sure to [include](../extensions.md#loading-extensions) `druid-lookups-cached-single` as an extension.
To use this extension [include](../extensions.md#loading-extensions) `druid-lookups-cached-single` as an extension.

Copy link
Copy Markdown
Member Author

@clintropolis clintropolis Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be something like

... include druid-lookups-cached-single in the extension load list.

so it isn't

this extension ... as an extension.

?

> For Postgres, the connector JAR is already included.
> For MySQL, you can get it from https://dev.mysql.com/downloads/connector/j/.
> Copy or symlink the downloaded file inside the folder `extensions/druid-lookups-cached-single` under the distribution root directory.
> See the MySQL extension documentation for instructions on how to obtain for [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> See the MySQL extension documentation for instructions on how to obtain for [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.
> See the MySQL extension documentation for instructions to obtain [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.

> Lookups are an [experimental](../experimental.md) feature.

To use this Apache Druid extension, make sure to [include](../../development/extensions.md#loading-extensions) `druid-lookups-cached-global` as an extension.
To use this Apache Druid extension, make sure to [include](../extensions.md#loading-extensions) `druid-lookups-cached-global` as an extension.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To use this Apache Druid extension, make sure to [include](../extensions.md#loading-extensions) `druid-lookups-cached-global` as an extension.
To use this Apache Druid extension, [include](../extensions.md#loading-extensions) `druid-lookups-cached-global` as an extension.

> If using JDBC, you will need to add your database's client JAR files to the extension's directory.
> For Postgres, the connector JAR is already included.
> For MySQL, you can get it from https://dev.mysql.com/downloads/connector/j/.
> See the MySQL extension documentation for instructions on how to obtain for [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> See the MySQL extension documentation for instructions on how to obtain for [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.
> See the MySQL extension documentation for instructions to obtain [MySQL](./mysql.md#installing-the-mysql-connector-library) or [MariaDB](./mysql.md#alternative-installing-the-mariadb-connector-library) connector libraries.

To use this Apache Druid extension, make sure to [include](../../development/extensions.md#loading-extensions) `mysql-metadata-storage` as an extension.

> The MySQL extension requires the MySQL Connector/J library which is not included in the Druid distribution.
> The MySQL extension requires the MySQL Connector/J library or MariaDB Connector/J library, neither of which is not included in the Druid distribution.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> The MySQL extension requires the MySQL Connector/J library or MariaDB Connector/J library, neither of which is not included in the Druid distribution.
> The MySQL extension requires the MySQL Connector/J library or MariaDB Connector/J library, neither of which are included in the Druid distribution.

Double negative. Looks like neither are included.

THis extension also supports using the MariaDB connector jar, though it is also not included in the Druid distribution and must be installed separately like the MySQL connector.

- Download from the MariaDB site: https://mariadb.com/downloads/connector
- Maven Central: https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.3/mariadb-java-client-2.7.3.jar
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Maven Central: https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.3/mariadb-java-client-2.7.3.jar
- Download from Maven Central: https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.3/mariadb-java-client-2.7.3.jar

- Download from the MariaDB site: https://mariadb.com/downloads/connector
- Maven Central: https://repo1.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.7.3/mariadb-java-client-2.7.3.jar

This should fetch a JAR file named similar to 'maria-java-client-x.x.x.jar'.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This should fetch a JAR file named similar to 'maria-java-client-x.x.x.jar'.
This fetches the MariaDB connector JAR file with a name like 'maria-java-client-x.x.x.jar'.


Copy or symlink this file to `extensions/mysql-metadata-storage` under the distribution root directory.

In Druid properties, `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver` must be set, which will instruct the `mysql-metadata-storage` extension to use the MariaDB connector library instead of MySQL. Depending on the MariaDB client library version, it will support both `jdbc:mysql:` and `jdbc:mariadb:` connection URIs, though the parameters to configure the connection vary between implementations, so be sure to [check the documentation](https://mariadb.com/kb/en/about-mariadb-connector-j/#connection-strings) for details.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In Druid properties, `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver` must be set, which will instruct the `mysql-metadata-storage` extension to use the MariaDB connector library instead of MySQL. Depending on the MariaDB client library version, it will support both `jdbc:mysql:` and `jdbc:mariadb:` connection URIs, though the parameters to configure the connection vary between implementations, so be sure to [check the documentation](https://mariadb.com/kb/en/about-mariadb-connector-j/#connection-strings) for details.
To configure the `mysql-metadata-storage` extension to use the MariaDB connector library instead of MySQL, set the following in the Druid properties: `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver`
Depending on the MariaDB client library version, the connector supports both `jdbc:mysql:` and `jdbc:mariadb:` connection URIs. However, the parameters to configure the connection vary between implementations, so be sure to [check the documentation](https://mariadb.com/kb/en/about-mariadb-connector-j/#connection-strings) for details.

[http://dev.mysql.com/downloads/mysql/](http://dev.mysql.com/downloads/mysql/)
[http://dev.mysql.com/downloads/mysql/](http://dev.mysql.com/downloads/mysql/).

This extension should also function correctly using MariaDB server, https://mariadb.org/download/, substituting for MariaDB in the following instructions where appropriate.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This extension should also function correctly using MariaDB server, https://mariadb.org/download/, substituting for MariaDB in the following instructions where appropriate.
This extension should also supports MariaDB server, https://mariadb.org/download/, substituting for MariaDB in the following instructions where appropriate.

druid.metadata.storage.connector.password=diurd
```

If using MariaDB, `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver` must also be set.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If using MariaDB, `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver` must also be set.
If using MariaDB, set `druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver`.

Copy link
Copy Markdown
Contributor

@techdocsmith techdocsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@clintropolis
Copy link
Copy Markdown
Member Author

hmm, we need to figure out how to make the code coverage bot ignore log statements I think...

@clintropolis
Copy link
Copy Markdown
Member Author

skipping CI since changes are basically doc only, and those jobs are passing

@clintropolis clintropolis merged commit ec334a6 into apache:master Aug 19, 2021
@clintropolis clintropolis deleted the maria-db-docs branch August 19, 2021 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants