Support Questions

Find answers, ask questions, and share your expertise
Announcements
Now Live: Explore expert insights and technical deep dives on the new Cloudera Community BlogsRead the Announcement

Configuration kerberos authorization via JDBC for apach hive.

avatar
Frequent Visitor

I'm running Apach Hive in a Docker container and using the following image:  https://github.com/big-data-europe/docker-hive

I want to add kerberos authorization to connect to Apach Hive via JDBC from a Java application.

everything I could find:

hive-site.xml

 

 

 

<property>
  <name>hive.server2.authentication</name>
  <value>KERBEROS</value>
</property>
<property>
  <name>hive.server2.authentication.kerberos.principal</name>
  <value>hive/hive-server.example.com@EXAMPLE.COM</value>
</property>
<property>
  <name>hive.server2.authentication.kerberos.keytab</name>
  <value>/home/mykeytab.keytab</value>
</property>

 

 

 

I generated a valid keytab file but the container start and after a while stoped.

There is only one configuration file in the container repository:

ivysettings.xml

 

 

 

<ivysettings>
  <!--name of the defaultResolver should always be 'downloadGrapes'. -->
  <settings defaultResolver="downloadGrapes"/>
  <!-- Only set maven.local.repository if not already set -->
  <property name="maven.local.repository" value="${user.home}/.m2/repository" override="false" />
  <property name="m2-pattern"
            value="file:${maven.local.repository}/[organisation]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]"
            override="false"/>
  <resolvers>
    <!-- more resolvers can be added here -->
    <chain name="downloadGrapes">
      <!-- This resolver uses ibiblio to find artifacts, compatible with maven2 repository -->
      <ibiblio name="central" m2compatible="true"/>
      <url name="local-maven2" m2compatible="true">
        <artifact pattern="${m2-pattern}"/>
      </url>
      <!-- File resolver to add jars from the local system. -->
      <filesystem name="test" checkmodified="true">
        <artifact pattern="/tmp/[module]-[revision](-[classifier]).jar"/>
      </filesystem>

    </chain>
  </resolvers>
</ivysettings>

 

 

 

For what reason might this not work? It would be great to see an example of configuring kerberos for Apach Hive

1 REPLY 1

avatar
Rising Star

Could you please try the steps detailed at https://hub.docker.com/r/apache/hive

If you want to use your own core-site.xml/hdfs-site.xml/yarn-site.xml or hive-site.xml for the service, you can provide the environment variable HIVE_CUSTOM_CONF_DIR for the command. For example:

Put the custom configuration file under the directory /opt/hive/conf and run:

docker run -d -p 9083:9083 --env SERVICE_NAME=metastore \--env DB_DRIVER=postgres -v /opt/hive/conf:/hive_custom_conf --env HIVE_CUSTOM_CONF_DIR=/hive_custom_conf \--name metastore apache/hive:${HIVE_VERSION}