Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can install a stable release of Hive by downloading and unpacking a tarball, or you can download the source code and build Hive using Maven (release 3.6.3 and later).Hive installation has these requirements:

Prerequisites

  • Java 8.
  • Maven 3.6.3
  • Protobuf 2.5
  • Hadoop 3.3.6 (As a preparation, configure it in single-node cluster, pseudo-distributed mode)
  • Tez. The default is MapReduce but we will change the execution engine to Tez.
  • Hive is commonly used in production Linux environment. Mac is a commonly used development environment. The instructions in this document are applicable to Linux and Mac.  

Install the prerequisites

Java 8

Building Hive requires JDK 8 installed. Some notes in case you have ARM chipset (Apple M1 or later).

You will have to build protobuf 2.5 later. And it doesn't compile with ARM JDK. So we will install intel architecture's Java with brew and configure maven with this. It will enable us to compile protobuf. 

JDK install on apple arm: 

Code Block
languagebash
titleJDK 8 on arm
brew install homebrew/cask-versions/adoptopenjdk8 --cask
brew untap adoptopenjdk/openjdk

Maven: 

Just install maven and configure the JAVA_HOME properly. 

Notes for arm: after a proper configuration, you should see something like this:

Code Block
languagebash
titlemvn configured on arm
mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/yourusername/programs/apache-maven-3.6.3
Java version: 1.8.0_292, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre
Default locale: en_HU, platform encoding: UTF-8
OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

As you can see, even if it is an arm processor, maven thinks the architecture is Intel based.

Protobuf

You have to download and compile protobuf. And also, install it into the local maven repository. Protobuf 2.5.0 is not ready for ARM. On this chipset, you will need to do some extra steps.

Code Block
languagebash
titlemvn configured on arm
wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
tar -xvf protobuf-2.5.0.tar.bz2
cd protobuf-2.5.0
./configure

On ARM, edit the src/google/protobuf/stubs/platform_macros.h and add arm to the part, processor architecture detection, after the last elif branch: 
 

Code Block
languagebash
titlemvn configured on arm
#elif defined(__arm64__)
#define GOOGLE_PROTOBUF_ARCH_ARM 1
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1

Now, you can compile and install protobuf:

Code Block
languagebash
titlemvn configured on arm
make
make check
sudo make install

You can validate your install:

Code Block
languagebash
titlemvn configured on arm
protoc --version

Hadoop

Firstly, move through the instructions on the official documentation, single-node, pseudo-distributed configuration: https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/SingleCluster.html#Pseudo-Distributed_Operation.


Installing from a Tarball

...