You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/metering-use-mysql-or-postgresql-for-hive.adoc
+33-18Lines changed: 33 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,23 @@
7
7
8
8
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.
9
9
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`.
11
11
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.
13
13
14
-
To create a secret in OpenShift CLI you can use the following command:
14
+
.Procedure
15
15
16
+
. Create a secret using the OpenShift CLI (`oc`) or by using a YAML file:
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
+
+
22
27
[source,yaml]
23
28
----
24
29
apiVersion: v1
@@ -30,11 +35,14 @@ data:
30
35
password: <BASE64_ENCODED_DATABASE_PASSWORD> <3>
31
36
----
32
37
<1> The name of the secret.
33
-
<2> Base64 encoded database username.
38
+
<2> Base64 encoded database user name.
34
39
<3> Base64 encoded database password.
35
40
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.
<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
+
+
58
72
[source,yaml]
59
73
----
60
74
spec:
@@ -70,4 +84,5 @@ spec:
70
84
username: "REPLACEME"
71
85
password: "REPLACEME"
72
86
----
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