Skip to content

Commit 036ea17

Browse files
committed
fix hive-metastore configuration problem
1 parent 5b7be73 commit 036ea17

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

charts/hive-metastore/templates/_helpers.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{/*
33
Expand the name of the chart.
44
*/}}
5-
{{- define "hive.name" -}}
5+
{{- define "hiveMetastore.name" -}}
66
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
77
{{- end -}}
88

@@ -12,7 +12,7 @@ We truncate at 54 chars because some Kubernetes name fields are limited to 63 (b
1212
as we append -datanode or -namenode to the names
1313
If release name contains chart name it will be used as a full name.
1414
*/}}
15-
{{- define "hive.fullname" -}}
15+
{{- define "hiveMetastore.fullname" -}}
1616
{{- if .Values.fullnameOverride -}}
1717
{{- .Values.fullnameOverride | trunc 54 | trimSuffix "-" -}}
1818
{{- else -}}
@@ -29,7 +29,7 @@ If release name contains chart name it will be used as a full name.
2929
Standard Labels from Helm documentation https://helm.sh/docs/chart_best_practices/#labels-and-annotations
3030
*/}}
3131

32-
{{- define "hive.labels" -}}
32+
{{- define "hiveMetastore.labels" -}}
3333
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
3434
app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
3535
app.kubernetes.io/instance: {{ .Release.Name | quote }}

charts/hive-metastore/templates/mestastore-configmap.yaml renamed to charts/hive-metastore/templates/configmap.yaml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: {{ include "hive.fullname" . }}
4+
name: {{ include "hiveMetastore.fullname" . }}
55
labels:
6-
app.kubernetes.io/name: {{ include "hive.name" . }}
7-
{{- include "hive.labels" . | nindent 4 }}
6+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
7+
{{- include "hiveMetastore.labels" . | nindent 4 }}
88
data:
99
hive-site.xml: |
1010
<?xml version="1.0"?>
1111
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
1212
<configuration>
1313
<property>
14-
<name>javax_jdo_option_ConnectionURL</name>
15-
<value>jdbc:postgresql://{{ .Release.Name }}-postgresql/metastore </value>
14+
<name>javax.jdo.option.ConnectionURL</name>
15+
<value>jdbc:postgresql://{{ .Release.Name }}-postgresql/metastore</value>
1616
</property>
1717
<property>
18-
<name>javax_jdo_option_ConnectionDriverName</name>
18+
<name>javax.jdo.option.ConnectionDriverName</name>
1919
<value>org.postgresql.Driver</value>
2020
</property>
2121
<property>
22-
<name>javax_jdo_option_ConnectionUserName</name>
22+
<name>javax.jdo.option.ConnectionUserName</name>
2323
<value>{{ .Values.postgresql.postgresqlUsername }}</value>
2424
</property>
2525
<property>
26-
<name> javax_jdo_option_ConnectionPassword</name>
27-
<value> {{ .Values.postgresql.postgresqlPassword }} </value>
26+
<name> javax.jdo.option.ConnectionPassword</name>
27+
<value>{{ .Values.postgresql.postgresqlPassword }}</value>
2828
</property>
2929
<property>
30-
<name>datanucleus_autoCreateSchema</name>
30+
<name>datanucleus.autoCreateSchema</name>
3131
<value>false</value>
3232
</property>
33+
{{- if not (index .Values.conf "hiveSite" "hive.metastore.uris") }}
34+
<property>
35+
<name>hive.metastore.uris</name>
36+
<value>thrift://{{ include "hiveMetastore.fullname" . }}:9083</value>
37+
</property>
38+
{{- end }}
3339
{{- if index .Values.conf "hiveSite" }}
3440
{{- range $key, $value := index .Values.conf "hiveSite" }}
3541
<property><name>{{ $key }}</name><value>{{ $value }}</value></property>

charts/hive-metastore/templates/metastore-postgresql-init.yaml renamed to charts/hive-metastore/templates/postgresql-init.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ kind: ConfigMap
33
metadata:
44
name: hive-metastore-postgresql-init
55
labels:
6-
app.kubernetes.io/name: {{ include "hive.name" . }}
7-
{{- include "hive.labels" . | nindent 4 }}
6+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
7+
{{- include "hiveMetastore.labels" . | nindent 4 }}
88
data:
99
00-hive-schema-2.3.0.postgres.sql: |-
1010
{{ tpl (.Files.Get "files/hive-schema-2.3.0.postgres.sql") . | indent 4 }}

charts/hive-metastore/templates/metastore-statefulset.yaml renamed to charts/hive-metastore/templates/statefulset.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
apiVersion: apps/v1
22
kind: StatefulSet
33
metadata:
4-
name: {{ include "hive.fullname" . }}-metastore
4+
name: {{ include "hiveMetastore.fullname" . }}
55
labels:
6-
app.kubernetes.io/name: {{ include "hive.name" . }}
6+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
77
app.kubernetes.io/component: metastore
8-
{{- include "hive.labels" . | nindent 4 }}
8+
{{- include "hiveMetastore.labels" . | nindent 4 }}
99
spec:
1010
selector:
1111
matchLabels:
12-
app.kubernetes.io/name: {{ include "hive.name" . }}
12+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
1313
app.kubernetes.io/component: metastore
14-
{{- include "hive.labels" . | nindent 6 }}
15-
serviceName: {{ include "hive.fullname" . }}-metastore
14+
{{- include "hiveMetastore.labels" . | nindent 6 }}
15+
serviceName: {{ include "hiveMetastore.fullname" . }}
1616
replicas: 1
1717
template:
1818
metadata:
1919
labels:
20-
app.kubernetes.io/name: {{ include "hive.name" . }}
20+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
2121
app.kubernetes.io/component: metastore
22-
{{- include "hive.labels" . | nindent 8 }}
22+
{{- include "hiveMetastore.labels" . | nindent 8 }}
2323
spec:
2424
containers:
2525
- name: metastore
@@ -28,8 +28,7 @@ spec:
2828
command:
2929
- "/bin/sh"
3030
- "-c"
31-
- "while true; do sleep 10; done"
32-
#- "/opt/hive/bin/hive --service metastore"
31+
- "/opt/hive/bin/hive --service metastore"
3332
resources:
3433
{{ toYaml .Values.resources | indent 10 }}
3534
# readinessProbe:
@@ -50,4 +49,4 @@ spec:
5049
volumes:
5150
- name: hive-config
5251
configMap:
53-
name: {{ include "hive.fullname" . }}
52+
name: {{ include "hiveMetastore.fullname" . }}

charts/hive-metastore/templates/metastore-svc.yaml renamed to charts/hive-metastore/templates/svc.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
apiVersion: v1
33
kind: Service
44
metadata:
5-
name: {{ include "hive.fullname" . }}-metastore
5+
name: {{ include "hiveMetastore.fullname" . }}
66
labels:
7-
app.kubernetes.io/name: {{ include "hive.name" . }}
7+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
88
app.kubernetes.io/component: metastore
9-
{{- include "hive.labels" . | nindent 4 }}
9+
{{- include "hiveMetastore.labels" . | nindent 4 }}
1010
spec:
1111
ports:
1212
- name: thrift
1313
port: 9083
1414
protocol: TCP
1515
selector:
16-
app.kubernetes.io/name: {{ include "hive.name" . }}
16+
app.kubernetes.io/name: {{ include "hiveMetastore.name" . }}
1717
app.kubernetes.io/component: metastore
1818
app.kubernetes.io/instance: {{ .Release.Name }}

0 commit comments

Comments
 (0)