Discovery

The Stackable Operator for Apache Hive publishes a discovery ConfigMap, which exposes a client configuration bundle that allows access to the Apache Hive cluster.

The bundle includes an Apache Thrift connection string to access the Hive Metastore service. This string may be used by other operators or tools to configure their products with access to Hive. Access is limited to services within the same Kubernetes cluster.

Example

Given the following Hive cluster:

apiVersion: hive.stackable.tech/v1alpha1
kind: HiveCluster
metadata:
  name: {clusterName} (1)
  namespace: {namespace} (2)
spec:
  clusterConfig:
    database:
      connString: jdbc:postgresql://postgresql:5432/hive
      user: hive
      password: hive
      dbType: postgres
  metastore:
    roleGroups:
      default: (3)
        replicas: 2
1 The name of the Hive cluster, which is also the name of the created discovery ConfigMap.
2 The namespace of the discovery ConfigMap.
3 A role group name of the metastore role.

The resulting discovery ConfigMap is {namespace}/{clusterName}.

Contents

Internal access

The {namespace}/{clusterName} discovery ConfigMap contains the following fields where {clusterName} represents the name, {namespace} the namespace of the cluster and {roleGroup} a role group of the metastore role:

HIVE

Contains the thrift protocol connection string for the Hive metastore service:

thrift://{clusterName}.{namespace}.svc.cluster.local:9083
Using the Hive metastore in high availability mode (replicas > 1) does not work with Derby but instead requires a properly configured database like PostgreSQL or MySQL.

External access

If spec.clusterConfig.listenerClass is set to external-unstable an additional ConfigMap is generated to expose external access to the cluster. This discovery ConfigMap is reachable via {namespace}/{clusterName}-nodeport.

Contains the thrift protocol connection string for the Hive metastore NodePort service:

thrift://<node-ip>:<nodeport>
thrift://<other-node-ip>:<nodeport>