Skip to content

Commit fb84628

Browse files
Merge pull request #29817 from lbarbeevargas/BZ-1915563-update-mysql-hive-metastore-config
BZ-1915563 Update metering MySQL Hive metastore configuration
2 parents 26e186a + b003bed commit fb84628

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

modules/metering-use-mysql-or-postgresql-for-hive.adoc

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77

88
The default installation of metering configures Hive to use an embedded Java database called Derby. This is unsuited for larger environments and can be replaced with either a MySQL or PostgreSQL database. Use the following example configuration files if your deployment requires a MySQL or PostgreSQL database for Hive.
99

10-
There are three configuration options you can use to control the database used by Hive metastore: `url`, `driver`, and `secretName`.
10+
There are three configuration options you can use to control the database that is used by Hive metastore: `url`, `driver`, and `secretName`.
1111

12-
Create your MySQL or Postgres instance with a username and password. Then create a secret by using the OpenShift CLI or a YAML file. The secretName you create for this secret must map to the spec.hive.spec.config.db.secretName field in the MeteringConfig resource.
12+
Create your MySQL or Postgres instance with a user name and password. Then create a secret by using the OpenShift CLI (`oc`) or a YAML file. The `secretName` you create for this secret must map to the `spec.hive.spec.config.db.secretName` field in the `MeteringConfig` object resource.
1313

14-
To create a secret in OpenShift CLI you can use the following command:
14+
.Procedure
1515

16+
. Create a secret using the OpenShift CLI (`oc`) or by using a YAML file:
17+
+
18+
* Create a secret by using the following command:
19+
+
1620
[source,terminal]
1721
----
1822
$ oc --namespace openshift-metering create secret generic <YOUR_SECRETNAME> --from-literal=username=<YOUR_DATABASE_USERNAME> --from-literal=password=<YOUR_DATABASE_PASSWORD>
1923
----
20-
21-
To create a secret by using a YAML file, use the following example file:
24+
+
25+
* Create a secret by using a YAML file. For example:
26+
+
2227
[source,yaml]
2328
----
2429
apiVersion: v1
@@ -30,11 +35,14 @@ data:
3035
password: <BASE64_ENCODED_DATABASE_PASSWORD> <3>
3136
----
3237
<1> The name of the secret.
33-
<2> Base64 encoded database username.
38+
<2> Base64 encoded database user name.
3439
<3> Base64 encoded database password.
3540

36-
Use the example configuration file below to use a MySQL database for Hive:
37-
41+
. Create a configuration file to use a MySQL or PostgreSQL database for Hive:
42+
+
43+
* To use a MySQL database for Hive, use the example configuration file below. Metering supports configuring the internal Hive metastore to use the MySQL server versions 5.6, 5.7, and 8.0.
44+
+
45+
--
3846
[source,yaml]
3947
----
4048
spec:
@@ -45,16 +53,22 @@ spec:
4553
create: false
4654
config:
4755
db:
48-
url: "jdbc:mysql://mysql.example.com:3306/hive_metastore"
49-
driver: "com.mysql.jdbc.Driver"
50-
secretName: "REPLACEME" <1>
56+
url: "jdbc:mysql://mysql.example.com:3306/hive_metastore" <1>
57+
driver: "com.mysql.cj.jdbc.Driver"
58+
secretName: "REPLACEME" <2>
5159
----
52-
<1> The name of the secret containing the base64-encrypted username and password database credentials.
53-
54-
You can pass additional JDBC parameters using the `spec.hive.config.url`. For more details see the https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html[MySQL Connector/J documentation].
55-
56-
Use the example configuration file below to use a PostgreSQL database for Hive:
57-
60+
[NOTE]
61+
====
62+
When configuring Metering to work with older MySQL server versions, such as 5.6 or 5.7, you might need to add the link:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-usagenotes-known-issues-limitations.html[`enabledTLSProtocols` JDBC URL parameter] when configuring the internal Hive metastore.
63+
====
64+
<1> To use the TLS v1.2 cipher suite, set `url` to `"jdbc:mysql://<hostname>:<port>/<schema>?enabledTLSProtocols=TLSv1.2"`.
65+
<2> The name of the secret containing the base64-encrypted user name and password database credentials.
66+
--
67+
+
68+
You can pass additional JDBC parameters using the `spec.hive.config.url`. For more details, see the link:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-configuration-properties.html[MySQL Connector/J 8.0 documentation].
69+
+
70+
* To use a PostgreSQL database for Hive, use the example configuration file below:
71+
+
5872
[source,yaml]
5973
----
6074
spec:
@@ -70,4 +84,5 @@ spec:
7084
username: "REPLACEME"
7185
password: "REPLACEME"
7286
----
73-
You can pass additional JDBC parameters using the URL. For more details see the https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters[PostgreSQL JDBC driver documentation].
87+
+
88+
You can pass additional JDBC parameters using the `spec.hive.config.url`. For more details, see the link:https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters[PostgreSQL JDBC driver documentation].

0 commit comments

Comments
 (0)